Forum


Replies: 8   Views: 4071
Line spacing in pdf different from docx
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 DaveH  · 14-10-2013 - 16:37

I'm generating DOCX and PDF files using the same exact template file. The DOCX is formatted exactly as it should be. The PDF is generated with extra line spacing, a different font, and it even removes some spaces between text.



I tried the solution from this post: http://www.phpdocx.com/forums/issues/v35-introduces-extra-paddingspacing-everywhere and it didn't seem to help.



To create the documents I'm using the addTemplate method, replacing some variables. After that, I'm using createDocxAndDownload() for the DOCX and TransformDoc()/generatePDF() for the PDF.



Has anyone else experienced this issue? Thanks in advance for any help!



Dave


Posted by jorgelj  · 15-10-2013 - 09:02

Hello,



The best PDF output is using PRO+ plugin conversion. PRO version uses a XSL file that return good results for simple documents.



Regards.


Posted by DaveH  · 15-10-2013 - 16:49

[quote=jorgelj]



Hello,



The best PDF output is using PRO+ plugin conversion. PRO version uses a XSL file that return good results for simple documents.



Regards.



[/quote]



Thanks for the response. We own the PRO+/Corporate edition. Is there a better way to convert PDFs other than the methods I'm using above that I'm not aware of?



Thanks!


Posted by jorgelj  · 15-10-2013 - 16:57

Hello,



You can get more information about conversion plugin included within PHPDocX Pro+ and Corporate on:



http://www.phpdocx.com/help/conversion-plugin-docx-to-pdf



http://www.phpdocx.com/documentation/pdf-conversion-plugin-installation-guide



Regards.


Posted by DaveH  · 21-10-2013 - 16:33

I just wanted to follow up with this issue. Thanks for providing those links. After researching, I found out that LibreOffice wasn't behaving and the OdfConverter wasn't quite set up properly. Once I had those up and running the PDF documents looked great. Thanks for the help!



Dave


Posted by prozesstool  · 28-10-2013 - 14:40

We have the same issue here, but we have no root-Access to our webspace, so we can't use the advanced conversion plugin. After researching i assume that the function "generateXHTML" generates the extra space between the lines. (outputed the html in browser)



Any suggestions?


Posted by prozesstool  · 28-10-2013 - 15:44

Here a screenshot of the word document (as provided by a customer, 1 page)



https://www.dropbox.com/s/rzeh03fivgg6m4i/word_tpl.PNG



and here a screenshot of the generated pdf (2 pages, huge line spacing, after replacing tpl vars)



https://www.dropbox.com/s/h2v54dvhs7mre5x/gen_pdf.PNG



 


Posted by jorgelj  · 29-10-2013 - 10:03

Hello,



The generateXHTML function uses an XSL to transform to XHTML and then transform the output to PDF.



You could change the XSL but it's complex. We recommend you to move to other server where you can install the conversion plugin.



Regards.