Forum


Replies: 3   Views: 2144
Keepnext not working when converting to pdf
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 kobbe  · 13-06-2019 - 08:55

I am using keepNext on headlines. I see it works correctly in word. But when using transformDocument to PDF the headline is still at the bottom of page. Is there a way to fix this?

I am using libreoffice as method.

 

Also from documenation:

https://www.phpdocx.com/api-documentation/word-content/insert-heading-Word-document-with-PHP

keepNext bool Keeps (whenever possible) in the same page the current paragraph with next paragraph (default value is false).

But it looks like addHeading has default value "on"... so it is not Bool? And Default value is wrong. Please update docs. :)

Posted by admin  · 13-06-2019 - 11:59

Hello,

What version of LibreOffice are you using? We have done some tests and keep next option is working correctly when transforming DOCX to PDF. If you send to contact[at]phpdocx.com the most simple DOCX that illustrate your issue we'll check it.

Thanks for the warning about the documentation issue on the addHeading page, we have removed the wrong default value comment on the documentation page. Option types are being checked.

Regards.

Posted by admin  · 13-06-2019 - 13:43

Hello,

After checking the DOCX, the problem was using an old version of LibreOffice (4.3), upgrading it solved the error.

Regards.

Posted by kobbe  · 13-06-2019 - 14:15

I am able to replicate on my local system running LibreOffice 6.1.3.2.

Sent you new file.