1

私はPHPDocxライブラリを使用しています。基本的に改ページに問題があります。これが私のコードです

    $html_body .= 'Lorem Ipsum is simply dummy text of the printing and typesetting industry';$html_body .= 'Lorem Ipsum is simply dummy text of the printing and typesetting industry';

両方の段落が別のページに表示されるようにページを分割したいだけです。私を助けてください。ありがとう

4

1 に答える 1

1

これを達成できる唯一の方法は、embedHTML() メソッドを使用している場合、html コードを分離し、その間に use addBreak() メソッドを追加することです。このようなもの:

require_once '../../../classes/CreateDocx.inc';

$docx = new CreateDocx();

$paragraph1 = '<p>Lorem Ipsum is simply dummy text of the printing and type setting industry</p>';
$paragraph2 = '</br><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>';

$docx->embedHTML($paragraph1);

$docx->addBreak(array('type' => 'page'));

$docx->embedHTML($paragraph2);

$docx->createDocx('example_embedHTML_1');
于 2015-03-23T07:52:59.910 に答える