Forum


Replies: 5   Views: 6498
Pdf conversion
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 dealcloser  · 10-04-2017 - 00:19

Hello,

We've recently purchased 2 Premium licenses, but we're unable to get the PDF conversion working. System specs are CentOS 7.3 / PHP 7 / Laravel 5.3 / OpenOffice 4.1.3 . Here is the basic code we're using:

use Phpdocx\Transform\TransformDocAdvOpenOffice;

$docx = new TransformDocAdvOpenOffice();
$docx->transformDocument('SampleAgreement.docx', 'SampleAgreement.pdf', null, array('debug' => true));

Below is output from Laravel's tinker:

$ php artisan tinker
Psy Shell v0.8.3 (PHP 7.0.14 — cli) by Justin Hileman
>>> use Phpdocx\Transform\TransformDocAdvOpenOffice;
=> null
>>> $docx = new TransformDocAdvOpenOffice();
=> Phpdocx\Transform\TransformDocAdvOpenOffice {#730}
>>> $docx->transformDocument('SampleAgreement.docx', 'SampleAgreement.pdf', null, array('debug' => true));
PHP error:  Undefined offset: 0 in vendor/phpdocx/Classes/Phpdocx/Parse/RepairPDF.inc on line 160
PHP error:  Undefined offset: 0 in vendor/phpdocx/Classes/Phpdocx/Parse/RepairPDF.inc on line 160
PHP error:  Undefined offset: 0 in vendor/phpdocx/Classes/Phpdocx/Parse/RepairPDF.inc on line 182

I've also tried running a test outside of Laravel with PHP CLI. The script is here:

require_once('Classes/Phpdocx/Create/CreateDocx.inc');

use Phpdocx\Transform\TransformDocAdvOpenOffice;

$docx = new TransformDocAdvOpenOffice();
$docx->transformDocument('SampleAgreement.docx', 'SampleAgreement.pdf', './', array('debug' => true));

The output from this script is as follows:

phpdocx/Classes/Phpdocx/Transform/../../../lib/OdfConverter/64/OdfConverter: error while loading shared libraries: libtiff.so.3: cannot open shared object file: No such file or directory
Apr 09, 2017 6:17:09 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection connect
INFO: connected
Apr 09, 2017 6:17:09 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection disposing
INFO: disconnected
Exception in thread "main" java.lang.IllegalArgumentException: inputFile doesn't exist: ./tempOdt_58eacf0596214.odt
        at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:90)
        at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:74)
        at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:70)
        at com.artofsolving.jodconverter.cli.ConvertDocument.convertOne(ConvertDocument.java:154)
        at com.artofsolving.jodconverter.cli.ConvertDocument.main(ConvertDocument.java:133)

These look like two different issues, but I'm not sure what's happening underneath the hood.