我生成Word和PDF格式渲染分页符在字与HTML
我使用头文件来生成字
header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=example.doc");
echo "<html>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">";
echo "<body>"; etc etc
所见即所得是创建下面的代码到一个文件中使用PHP文件渲染分页符
<div style="page-break-after: always;"><span style="display: none;"> </span></div>
这个html/css对于pdf输出工作正常,但不是word。
有人可以推荐一种替代方法来创建分页符可在Word中工作。
可能的重复 - http://stackoverflow.com/questions/1379351/new-line-formatting-when-using-html-file-as-word-file – DeaconDesperado
发行是分页符还是换行符 – user1019144
您是否尝试过输出一个FormFeed字符()? –