Forum


Replies: 9   Views: 7746
Openoffice version
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 LenB  · 28-07-2012 - 22:37

Moving forward, the issue involving the JRE not found error is likely a Ubuntu issue. Is it necessary to run the version of OpenOffice packaged with PHPDocx, or can I run the version packaged for our OS on with the correct parameters? This would simplify things.
Regards,
-Len

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

Hello,

You can use any openoffice version, just indicate it's path to run openoffice as service.

Regards.

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

OpenOffice is now running launched by the commandline:
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
and responding on localhost:8100:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
`ø'com.sun.star.bridge.XProtocolPropertiesUrpProtocolPropertiesFø3)F)¾#
\!üC

When we test by pointing a browser at
phpdocx/examples/advanced/Transform.php
it creates
phpdocx/examples/advanced/example_text.docx. However, it does not create
example_text.pdf, it displays a blank
screen. We verified that the file does not exist.

When I write my own version of this, the same thing happens: I create the
.docx file on the server, and call transformDocx, which executes, displays a
blank screen, and generates nothing.

What is our next step in debugging the problem? Thank you for your time and assistance.

Regards,
-Len

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

Hello,

Please try creating an instance of this class: 'classes/TransformDocAdv.inc'. A simple example:

$transform = new TransformDocAdv();
$transform->transformDocument('from.docx', 'to.pdf');

run it using PHP CLI and paste here any error or message.

Regards.

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

Hi,

Len and I are working on this together. We created a simple test php program (tst.php, shown below), and copied the example_text.docx from the examples/docx directory to 'tst.docx'.

Here's the output of displaying the tst.php program followed by running it. We have tried this with 4 different .docx files from the examples/docx directory, and they all produce the same result.

Please advise.

Thank you,
Gary Hillerson and Len Burns

561 ~/secure_html/cloudApp: cat tst.php
<?php
require_once 'phpdocx/classes/TransformDocAdv.inc';
$transform = new TransformDocAdv();
$transform->transformDocument('tst.docx', 'tst.pdf');
?>
562 ~/secure_html/cloudApp:
562 ~/secure_html/cloudApp:
562 ~/secure_html/cloudApp: php tst.php
Aug 1, 2012 4:40:42 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection connect
INFO: connected
Aug 1, 2012 4:40:42 PM 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
563 ~/secure_html/cloudApp:

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

Which version of openoffice are you using?.

Seems:

Exception in thread “main” com.artofsolving.jodconverter.openoffice.connection.OpenOfficeException: conversion failed: could not load input document

DOCX files are not supported.

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

hi

I've a similar problem; but I don't get any error messages. It's the latest version of phpdocx

my code is:
$docx->createDocx('/tmp/example_header');
$docx->enableCompatibilityMode();
$docx -> transformDocx('example_header.docx','example_header.pdf');

the docx is created fine but not the pdf file.
my soffice -headless is up and running

if I run the code 'java -jar <path to the jar> docx pdf on command line it works fine.

if I run the above php code with php-cli it works fine.

If I run the php file via web the docs is created but not the pdf. I changed the system call and added the second param. @system(command,$retval)
The $retval is not zero which indicates an error, in this case 127. That could if I understand it correct be an indication of an permission problem.

so I logged in with another user; who has the "other" permission. The above tests works fine with this user.



any suggestions?

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

HI Gary and Len,

Did you happen to solve this issue? I am getting the same results: blank PDF file in web browser, and the following output when I php cli a test page:

php testpdf.php
10-sep-2012 10:07:01 com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection connect
INFO: connected
10-sep-2012 10:07:01 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


need this working quite urgently, hope anyone has the final insight (took me a few days to get this far).


thanks in advance,
Wouter Broekman

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

Hello,

Please contact us: http://www.phpdocx.com/contact

Regards.