Forum


Replies: 7   Views: 5988
Fatal error: class 'xsltprocessor' not found
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 lamador  · 28-04-2014 - 17:39

Hello, 



I'm trying to generate a PDF from a docx file with the generatePDF function, but I get this error message:



$:/var/www/.../phpdocx/examples/intermediate$ php DocxAndPdf.php 

PHP Fatal error:  Class 'XSLTProcessor' not found in /var/www/6conecta/components/com_seysconecta/lib/phpdocx/classes/TransformDoc.inc on line 266



 



I've tried also with the transformDocx function. In this case it works fine executing the example transform.php from the command line but if I do it in a script with the browser the proccess doesn't create the pdf file. I've cheked that the oppenoffcie is running.



$:/var/www/6conecta$ ps aux | grep openoffice

lamador   4139  0.0  0.0   2236   564 pts/3    S+   17:28   0:00 /bin/sh /opt/openoffice.org3/program/soffice -headless -accept=socket,host=127.0.0.1,port=8100;urp; -nofirststartwizard

lamador   4148 11.3  0.8 117728 35732 pts/3    Sl+  17:28   0:00 /opt/openoffice.org3/program/soffice.bin -headless -accept=socket,host=127.0.0.1,port=8100;urp; -nofirststartwizard

 



Can you help me?



 


Posted by lamador  · 29-04-2014 - 08:38

My phpdocx version is 3.7


Posted by jorgelj  · 29-04-2014 - 09:00

Hello,



As you can check on:



http://www.php.net/manual/en/class.xsltprocessor.php



That class is in PHP, you just need to install and enable the XSL extension.



Regards.


Posted by lamador  · 29-04-2014 - 09:57

Thank you so much, I though XLT processor was a phpdocx class.



Now I can convert into PDF a docx file generated with phpdocx using  generatePDF  function, but there are some things that are different in PDF:



- The header and footer are in the docx but doesn't appear in the pdf file.



- The width of the tables and cells are not the same in docx and pdf.



- The border of the tables and cells are not the same in docx and pdf.



Is there any list of rules that I have to follow to generate a docx with phpdocx that I can convert to pdf keeping all its features?



Thank you so much.


Posted by jorgelj  · 29-04-2014 - 10:13

Hello,



Are you using the conversion plugin to do the transformation?



Please check these pages:



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



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



Regards.


Posted by lamador  · 29-04-2014 - 13:24

I've follow the tutorial and I've installed openoffice and I've run it in headless mode with:



$ /opt/openoffice.org3/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard



The process is running:



$ ps -aux | grep soffice

lamador  12322  0.0  0.0   2236   560 pts/1    S+   12:56   0:00 /bin/sh /opt/openoffice.org3/program/soffice -headless -accept=socket,host=127.0.0.1,port=8100;urp; -nofirststartwizard

lamador  12331  1.4  0.8 117728 35720 pts/1    Sl+  12:56   0:00 /opt/openoffice.org3/program/soffice.bin -headless -accept=socket,host=127.0.0.1,port=8100;urp; -nofirststartwizard



If I run the OdfConverter 32-bit the output is:



$ lib/OdfConverter/32/OdfConverter /../Informe_2014-04-25-150654.docx 



[ERROR][/var/www/.../Informe_2014-04-25-150654.docx] Conversion failed - Error during conversion



I'm using the generatePDF function. I've also tried with the transformDocx function, but when I execute in a script with the browser (not in the command line) it doesn't genereate any pdf file and I don't get any error. 



Thank you so much.


Posted by jorgelj  · 29-04-2014 - 15:25

Hello,



Please run the included example, advances/Transformphp, using the CLI mode; this is:



$ php Transform.php



Note that there are four options to do the transformation; please try all of them and enable the debug mode (http://www.phpdocx.com/api-documentation/advanced-conversion-plugin/convert-Word-docx-into-pdf-with-PHP). And check your server logs to find any error or something missing.



Regards.