Forum


Replies: 2   Views: 5660
Add page break in html
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by davelavinsky  · 25-10-2016 - 15:44

I have a large chunk of HTML code which I'm inserting it via embedHTML

$docx->embedHTML($html);

But I want to insert page breaks before all my <h2> tags. I tried with <br/> but it didn't work.

I can't use $docx->addBreak(array('type' => 'page')); because I'm inserting a large chunk of pre-processed HTML code in which I have the page breaks.

Is there any way to get this done in HTML ?

Im using phpdocx 5.5 Advanced.

Thanks

 

Posted by admin  · 25-10-2016 - 18:07

Hello,

UPDATE: HTML Extended, available in Premium licenses, allows adding page breaks using the br tag with the data-type option (https://www.phpdocx.com/htmlapi-documentation/html-standard/insert-break-Word-document-with-HTML).

You can use page-break-* properties. Please check the Page break properties section on:

http://www.phpdocx.com/documentation/introduction/html-to-word-PHP

phpdocx 9 added HTML Extended that allows using custom HTML tags: https://www.phpdocx.com/documentation/introduction/html-extended-to-word-PHP

Regards.

Posted by davelavinsky  · 26-10-2016 - 10:25

Got it. Thanks.