Forum


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

Hi,

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/maris-online.nl/public_html/tst10/includes/phpdocx/pdf/class.tcpdf.php 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

Hello,

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

Regards.

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

Hi,

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/maris-online.nl/public_html/tst10/uploads/P1294831818/facturen/Sjabloonvoorbeeld<br/>
Filename: Sjabloonvoorbeeld<br/>
java -jar /home/pyramedia/domains/maris-online.nl/public_html/tst10/includes/phpdocx/classes/../lib/openoffice/jodconverter-2.2.2/lib/jodconverter-cli-2.2.2.jar /home/pyramedia/domains/maris-online.nl/public_html/tst10/uploads/P1294831818/facturen/Sjabloonvoorbeeld.docx /home/pyramedia/domains/maris-online.nl/public_html/tst10/uploads/P1294831818/facturen/Sjabloonvoorbeeld.pdf10-sep-2012 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(OpenOfficeDocumentConverter.java:131)
at com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.convertInternal(OpenOfficeDocumentConverter.java:120)
at com.artofsolving.jodconverter.openoffice.converter.AbstractOpenOfficeDocumentConverter.convert(AbstractOpenOfficeDocumentConverter.java:104)
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)
Caused by: com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one.
at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:182)
at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:148)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:344)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:313)
at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:101)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:652)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:154)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:136)
at $Proxy5.loadComponentFromURL(Unknown Source)
at com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.loadDocument(OpenOfficeDocumentConverter.java:150)
at com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter.loadAndExport(OpenOfficeDocumentConverter.java:127)
... 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.