Replies: 4   Views: 3698
Pdf not generated (linux)
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 pyramedia  · 07-09-2012 - 14:03


I'm almost there! Bought phpdocx corporate, uploaded it to my website, installed Tidy & XSL PHP extensions (recompiled php in the process), configured the component, etc etc.

Retrieving .docx template, filling it with data and saving it: no problems whatsoever. Brilliant. However the last step is giving me problems: converting to a PDF. OpenOffice service is running (I think), paths are ok etc.

An error is thrown (could be a warning, though): in file: /home/pyramedia/domains/ on line 4: Declaration of MYPDF::ImageSVG() should be compatible with that of TCPDF::ImageSVG()(error type 2048)

The script itself runs but there is no PDF saved.. What am I doing wrong? Desperately need this last step to work..

The final part of my code is:

//maak bestandsnaam factuur
$filename = 'Voorbeeld ' . $factuurnr;
$fullfile = APP_RELPATH . '/uploads/' . $_SESSION['klantcode'] . '/facturen/' . $filename;
$fullpath = APP_PATH . '/uploads/' . $_SESSION['klantcode'] . '/facturen/' . $filename;
echo $fullfile;

$docx->createDocx($fullfile);//we send the resulting document to the browser
$docx->transformDocx($fullfile . '.docx', $fullfile . 'test.pdf');

Thanks in advance,

Wouter Broekman
Pyramedia BV

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


Please remove pdf/_class.tcpdf.php file, seems you're having some issues with that custom file.


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


thanks for the reply. The file you mentioned is not available on my webserver. In the meantime I did more testing and debugging and finally got to this point; a common issue I read but not a standard solution:

(same code);

Fullfile: /home/pyramedia/domains/<br/>
Filename: Sjabloonvoorbeeld<br/>
java -jar /home/pyramedia/domains/ /home/pyramedia/domains/ /home/pyramedia/domains/ 10:33:45 com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection connect
INFO: connected
10-sep-2012 10:33:45 com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection disposing
INFO: disconnected
Exception in thread "main" com.artofsolving.jodconverter.openoffice.connection.OpenOfficeException: conversion failed: could not load input document
at com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.loadAndExport(
at com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(
at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(
at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(
at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(
at com.artofsolving.jodconverter.cli.ConvertDocument.convertOne(
at com.artofsolving.jodconverter.cli.ConvertDocument.main(
Caused by: URL seems to be an unsupported one.
at $Proxy5.loadComponentFromURL(Unknown Source)
at com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.loadDocument(
at com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.loadAndExport(
... 6 more
Could not run jodconverter

which steps can I take to debug this?

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

Did some more testing - this is a critical issue for our application so it has all my focus. I got the createdocx and transformdocx classes working in my web application (doesn't work from command line, though). after finding the right fonts to use in the templates (helvetica, others rendered invisible character), I have two major issues remaining:

- our template (made in Word 2010) is converted into PDF but doesn't look anything like the template. No headers, no footers, no images and alignment is wrong in all places.

Any experiences with this? To be honest it's getting to be a bit of a dissapointment. I understand that phpdocx is working fine and the problems are mainly in OpenOffice and the jodconverter, but as a whole, it's not really working for me.