Forum


Replies: 3   Views: 2749
Pdf transformation not working
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 skilltran  · 21-06-2018 - 18:57

Even with a simple example, the PDF file doesn't get created.  From a web request, there are no errors.

We're using a CentOS 6 operating system.

Here's the PHP code we're using:

<?php

include '../rpcl/phpdocx/classes/CreateDocx.php';

$docx = new CreateDocx();

$docx->enableCompatibilityMode();
$text = 'This is a test';
$paramsText = array( 'b' => 'single', 'font' => 'Arial' );
$docx->addText($text, $paramsText);

$docx->createDocx('../reportcache/example_text');

$transform = new TransformDocAdvOpenOffice();
$path = realpath('../reportcache/example_text.docx');
$transform->transformDocument($path, str_replace('.docx', '.pdf', $path), realpath('../reportcache/'), array('debug' => true, 'method' => 'script'));

?>

Running from the command line, we get this:

ERROR: connection failed.  Please make sure OpenOffice.org is running and listening on port 8100.

Using "ps -ef" we can confirm that open office is running.  This is the command we used to start it:

# /opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp" -nofirststartwizard &
 

Any help would be greatly appreciated.

Thanks,
Jeff Truthan

 

Posted by admin  · 21-06-2018 - 19:06

Hello,

On https://www.phpdocx.com/documentation/conversion-plugin/debugging-openoffice you can find the steps to debug it. If the script is unable to connect to OpenOffice, the most common issue is that some program is blocking it, such as a   firewall like iptables, or SELinux; we recommend you to check your server logs to find what program is blocking PHP access OpenOffice.

Anyway, since phpdocx 4.5, the recommended conversion plugin to get the best output is the one based on LibreOffice, we strongly recommend using this one.

Regards.

Posted by skilltran  · 26-06-2018 - 18:38

Thank you for such a quick response!

We've begun the process of converting over to LibreOffice as suggested.  We're hosting with RackSpace, which doesn't allow for any GUI installs.

This is a list of the modules that can be installed - can you tell us which ones are essential for the PDF conversion process to work?  We don't want to install more than is necessary, and the documentation appears to recommend a GUI install process.

Thank you, in advance, for your guidance!
 

-rw-r--r-- 1 root root   2455398 May 10 01:26 libobasis5.4-base-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root  11502360 May 10 01:26 libobasis5.4-calc-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root 121221022 May 10 01:25 libobasis5.4-core-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root      6114 May 10 01:27 libobasis5.4-draw-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root     90247 May 10 01:28 libobasis5.4-en-US-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root     18544 May 10 01:27 libobasis5.4-en-US-base-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root     43928 May 10 01:28 libobasis5.4-en-US-calc-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root      7580 May 10 01:26 libobasis5.4-en-US-math-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    139060 May 10 01:27 libobasis5.4-en-US-res-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root      2677 May 10 01:26 libobasis5.4-en-US-writer-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    387071 May 10 01:28 libobasis5.4-extension-beanshell-script-provider-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    610536 May 10 01:26 libobasis5.4-extension-javascript-script-provider-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   2247945 May 10 01:27 libobasis5.4-extension-mediawiki-publisher-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   1161931 May 10 01:27 libobasis5.4-extension-nlpsolver-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    966332 May 10 01:26 libobasis5.4-extension-pdf-import-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   3522522 May 10 01:26 libobasis5.4-extension-report-builder-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root  50994180 May 10 01:28 libobasis5.4-firebird-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    544247 May 10 01:27 libobasis5.4-gnome-integration-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   4162676 May 10 01:28 libobasis5.4-graphicfilter-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   6255558 May 10 01:27 libobasis5.4-images-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    828102 May 10 01:27 libobasis5.4-impress-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    106439 May 10 01:28 libobasis5.4-kde-integration-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    218599 May 10 01:28 libobasis5.4-librelogo-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    605420 May 10 01:26 libobasis5.4-math-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    115629 May 10 01:25 libobasis5.4-ogltrans-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    185766 May 10 01:27 libobasis5.4-onlineupdate-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root  22449386 May 10 01:28 libobasis5.4-ooofonts-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root      2634 May 10 01:27 libobasis5.4-ooolinguistic-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   1576760 May 10 01:27 libobasis5.4-postgresql-sdbc-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root     12646 May 10 01:28 libobasis5.4-python-script-provider-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root  12420573 May 10 01:26 libobasis5.4-pyuno-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   5818824 May 10 01:23 libobasis5.4-writer-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    450585 May 10 01:23 libobasis5.4-xsltfilter-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   1629925 May 10 01:26 libreoffice5.4-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root      2243 May 10 01:27 libreoffice5.4-base-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root      2242 May 10 01:26 libreoffice5.4-calc-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   6475120 May 10 01:27 libreoffice5.4-dict-en-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   1402909 May 10 01:27 libreoffice5.4-dict-es-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   2208968 May 10 01:23 libreoffice5.4-dict-fr-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root      2243 May 10 01:28 libreoffice5.4-draw-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root      7787 May 10 01:28 libreoffice5.4-en-US-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root   6503153 May  9 12:14 libreoffice5.4-freedesktop-menus-5.4.7-2.noarch.rpm
-rw-r--r-- 1 root root      2272 May 10 01:28 libreoffice5.4-impress-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root      2243 May 10 01:26 libreoffice5.4-math-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root  15432597 May 10 01:26 libreoffice5.4-ure-5.4.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root      2264 May 10 01:27 libreoffice5.4-writer-5.4.7.2-2.x86_64.rp
 

Posted by admin  · 27-06-2018 - 07:31

Hello,

We recommend you to install all RPMs. LibreOffice has many internal dependencies.

We also recommend you to download and install the latest release available on https://www.libreoffice.org/

Regards.