Forum


Replies: 14   Views: 4718
Generatepdf / transformdocx
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 davidgsd  · 01-02-2013 - 12:02

We are currently working on a project that will take an existing .docx file from the server and from there create a PDF version.

Using the method generatePDF we can produce a PDF from the .docx without issue, however we are then prompted to open or save. We need the file to be created on the server which I would think you would use the transformDOCX method.

The first issue is that the transformDOCX method produces nothing, no error, no file and if I wrap an IF statement around it to test it always returns false.

[code]
ini_set("memory_limit","500M");

require_once '../../phpdocx/classes/TransformDoc.inc';
require_once '../../phpdocx/classes/CreateDocx.inc';

$docx = new CreateDocx();
$docx->enableCompatibilityMode();

if($docx->transformDocx('example_text.docx', 'example_text.pdf')) {
echo "success";
} else {
echo "fail";
}
[/code]

The existing file is 777 permissions and even if I use the example provided wherein the document is created first the .docx document is created fine but still no PDF and again no error.

We are using the PRO version, any ideas where to start looking at this?

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

Hello,

Please start OpenOffice in headless mode and run Transform.php example in CLI mode and paste your output.

Regards.

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

/var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/classes/../lib/openoffice/openoffice.org3/program/soffice: line 120: /var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/lib/openoffice/openoffice.org3/program/soffice.bin: Permission denied
sh: java: command not found
sh: /var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/classes/../lib/OdfConverter: Permission denied
/var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/classes/../lib/openoffice/openoffice.org3/program/soffice: line 84: /var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/lib/openoffice/openoffice.org3/program/../basis-link/program/pagein: No such file or directory
/var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/classes/../lib/openoffice/openoffice.org3/program/soffice: line 120: /var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/lib/openoffice/openoffice.org3/program/soffice.bin: Permission denied
sh: java: command not found
sh: /var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/classes/../lib/OdfConverter: Permission denied
sh: java: command not found

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

Ok sorted permission issue - now this -

[code]error while loading shared libraries: libgthread-2.0.so.0: cannot open shared object file: No such file or director[/code]

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

Hello,

What distribution are you using?.

Regards.

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

Hi,

Its 3.1 PRO as far as I am aware.

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

The full response is as below:

[code]
java: command not found
/var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/classes/../lib/OdfConverter: error while loading shared libraries: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
sh: java: command not found
[/code]

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

Hello,

Linux distribution, not phpdocx package version. this is RedHat, Debian, CentOs, Ubuntu.

About this error:

--------------------------------------------------------
sh: java: command not found
--------------------------------------------------------

You need to install jre.

Regards.

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

Redhat Enterprise Linux 5

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

JRE is now installed - I suspect I see the issue as the required file libgthread-2.0.so.0 is in /lib64 and not /lib - is there a path somewhere I can change for this?

Updated errors:

[code]/var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/classes/../lib/OdfConverter: error while loading shared libraries: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
/var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/lib/openoffice/openoffice.org3/program/../basis-link/ure-link/bin/javaldx: /lib/libc.so.6: version `GLIBC_2.7' not found (required by /var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/lib/openoffice/openoffice.org/ure/bin/../lib/libuno_sal.so.3)
/var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/lib/openoffice/openoffice.org3/program/../basis-link/ure-link/bin/javaldx: /lib/libc.so.6: version `GLIBC_2.7' not found (required by /var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/lib/openoffice/openoffice.org/ure/bin/../lib/libxml2.so.2)
/var/www/html/dev.brushbpi.gsd.net/public_html/phpdocx/lib/openoffice/openoffice.org3/program/soffice.bin: error while loading shared libraries: libXext.so.6: cannot open shared object file: No such file or directory
ERROR: connection failed. Please make sure OpenOffice.org is running and listening on port 8100.
ERROR: connection failed. Please make sure OpenOffice.org is running and listening on port 8100.[/code]

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

Hello,

Please read this page:

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

There's a point that explain a solution for GLIBC 2.7 error.
Did you start OpenOffice in headless mode?. And please try the three ways available in advanced/Transform.php example.

Regards.

Posted by smartbit  · 08-07-2013 - 10:25

When I try to run openoffice in headless mode I get this response:



Terminal command:




vagrant@vagrant-debian-squeeze:/var/www/trunk/lib/phpdocx$ lib/openoffice/openoffice.org3/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard


Response:




/var/www/trunk/lib/phpdocx/lib/openoffice/openoffice.org3/program/../basis-link/ure-link/bin/javaldx: error while loading shared libraries: libuno_sal.so.3: cannot open shared object file: No such file or directory



/var/www/trunk/lib/phpdocx/lib/openoffice/openoffice.org3/program/soffice.bin: error while loading shared libraries: libuno_sal.so.3: cannot open shared object file: No such file or directory


 


Posted by smartbit  · 08-07-2013 - 11:33

The uno-libs3 library is installed, bu I still get the error above...


Posted by jorgelj  · 09-07-2013 - 08:48

Hello,



As you're using an AMD64 distribution, we recommend you to install this version of OpenOffice:



http://www.openoffice.org/download/other.html



RPM or DEB depending on your distribution. And uninstall any version of LibreOffice.



Regards.