Forum


Replies: 3   Views: 4515
Auto page break when new paragraph
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 XsTatiC  · 14-02-2013 - 19:00

Before purchase, I have a question that I can't seem to find the answer to. Help would be greatly appreciated.

I'm wondering if there's a way to achieve this output programatically using phpdocx.

Is it possible that if the text content of a specific dom object is going to spread from the bottom of one page to the top of another, to automatically insert a page break?

Basically if I have a 20 divs class="contentDiv" to only have the full content of any div on a single page. I don't mean putting 20 divs on 20 pages... it could very well be 5 on one page, 12 on the second and 3 on the last. Just that it's never the case where there are 5.5 on the first page, 11.5 on the second and 3 on the last.

The content of the divs is dynamic and will vary a lot on each generation of the Word document.

addBreak seems to be basic add line/page break, but not with any parameters to achive my goal.

addParagraph has an option for pageBreakBefore, but it looks to be just a boolean on/off without an auto.

It looks like this functionality is fully implemented with PDF output in regards to the reflower which looks as if it checks current dom height against current page height and inserts page breaks appropriately. I'm sure that's just an advantage of PDF over Word as far as generated output. PDF may be fine for my solution..... can I pass generated html (php) page to phpdocx and have it do the above for pdf output?

Thanks.. hopefully that all makes sense.

Cheers

Posted by admin  · 11-04-2013 - 12:13

Hello,

You can do manual breaks but not change how to auto break works in Word. In PDF is possible to force breaks but not in DOCX.

Regards.

Posted by XsTatiC  · 11-04-2013 - 12:13

[quote][b]Quote from admin on February 15, 2013, 08:21[/b]
Hello,

You can do manual breaks but not change how to auto break works in Word. In PDF is possible to force breaks but not in DOCX.

Regards.[/quote]

Thank you for verifying.

Cheers.