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.
Hello,
We had PDF Transform working on initial install, but now can not convert docx to PDF after moving to a new server.
No error messages appear. Here is log for the example script copies from the web site.
Log:
2014-12-03T07:21:21-08:00 phpdocx_logger INFO Set language: en-US
2014-12-03T07:21:21-08:00 phpdocx_logger INFO Enable compatibility mode.
2014-12-03T07:21:21-08:00 phpdocx_logger INFO Add text to word document.
2014-12-03T07:21:21-08:00 phpdocx_logger INFO Set DOCX name to: example_text.
2014-12-03T07:21:21-08:00 phpdocx_logger INFO Set DOCX name to: example_text.
2014-12-03T07:21:21-08:00 phpdocx_logger INFO Remove existing template tags.
2014-12-03T07:21:21-08:00 phpdocx_logger INFO Add word/document.xml content to DOCX file.
2014-12-03T07:21:21-08:00 phpdocx_logger INFO Close ZIP file
2014-12-03T07:21:21-08:00 phpdocx_logger INFO Copy DOCX file using a new name.
PHP_VERSION: 5.4.17
PHP_OS: Darwin
PHP_UNAME: Darwin dscfmserver.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
SERVER_NAME: client.dalescott.com
SERVER_SOFTWARE: Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/0.9.8za
SERVER_ADDR: 192.168.40.7
SERVER_PROTOCOL: HTTP/1.1
HTTP_HOST: client.dalescott.com
HTTP_X_FORWARDED_FOR:
PHP_SELF: /dev/phpdocx/check.php
XSLTProcessor: 1
ZipArchive: 1
DomDocument: 1
SimpleXMLElement: 1
Tidy: 1
in other post to this forum, I see references to an advanced script, but don't seem to have that script in our product.
What to do?
Jonathan
Hello,
We recommend you to enable the debug option in the transformDocument method, run the transformation using the CLI mode and check the output and server log.
Regards.
Thanks for your reply.
We are on OS X. Can you provide explicit instructions on how to run from Command Line, including how to invoke debug? Terminal skills are so-so.
Thanks
A follow up...
Running the test script from CL (php test.php), the following error is displayed: No Java runtime present, requesting install.
However, Java IS installed. 7.70 is installed and working as part of FileMaker Server on Mac OS X 10.9.5.
Also, I was able to overcome permissions issues by using umask(0000) in the php script.
Still trying to resolve this.
Jonathan
More info...
From the Apache log which is found running under FileMaker Server 13 Web Engine:
sh: /Library/FileMaker: No such file or directory
No Java runtime present, requesting install.
2014-12-03 10:47:40.032 java[54908:1107] JLRequestRuntimeInstall: Error calling: CFMessagePortCreateRemote
For reference, the previous installations was also running under FileMaker Server, but version 12.
Once again, Java IS installed, since FileMaker Server requires it.
Still looking for a solution...
More info:
Running transformDocument with these parameters:
$docx->transformDocument('test/example_text.docx', 'test/example_text.pdf', array('debug'=> true));
Running the test.php script from Command Line.
Now getting the following errors in the console:
PHP Warning: copy(Array/tempDocX_547f612062d0a.docx): failed to open stream: No such file or directory in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/TransformDocAdv.inc on line 58
Warning: copy(Array/tempDocX_547f612062d0a.docx): failed to open stream: No such file or directory in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/TransformDocAdv.inc on line 58
PHP Warning: ZipArchive::getFromName(): Invalid or unitialized Zip object in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/TransformDocAdv.inc on line 64
Warning: ZipArchive::getFromName(): Invalid or unitialized Zip object in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/TransformDocAdv.inc on line 64
PHP Warning: ZipArchive::getFromName(): Invalid or unitialized Zip object in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/TransformDocAdv.inc on line 65
Warning: ZipArchive::getFromName(): Invalid or unitialized Zip object in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/TransformDocAdv.inc on line 65
PHP Warning: DOMDocument::loadXML(): Empty string supplied as input in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/RepairPDF.inc on line 54
Warning: DOMDocument::loadXML(): Empty string supplied as input in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/RepairPDF.inc on line 54
PHP Warning: ZipArchive::addFromString(): Invalid or unitialized Zip object in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/TransformDocAdv.inc on line 67
Warning: ZipArchive::addFromString(): Invalid or unitialized Zip object in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/TransformDocAdv.inc on line 67
PHP Warning: ZipArchive::close(): Invalid or unitialized Zip object in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/TransformDocAdv.inc on line 69
Warning: ZipArchive::close(): Invalid or unitialized Zip object in /Library/FileMaker Server/HTTPServer/htdocs/httpsRoot/phpdocx/classes/TransformDocAdv.inc on line 69
sh: /Library/FileMaker: No such file or directory
No Java runtime present, requesting install.
Thank you.
Jonathan
Hello,
Please check the method:
public transformDocument (string $source, string $target [, string $tempDir [, array $options]])
The third parameter of the transformDocument is the tempdir, not the options array. Change it and try again.
Regards.
Hello,
transformDocument parameters edited, per suggestion.
Docx is created, but no PDF doc.
Here is entire script:
enableCompatibilityMode();
$text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' .
'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut ' .
'enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut' .
'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit ' .
'in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' .
'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui ' .
'officia deserunt mollit anim id est laborum.';
$paramsText = array(
'b' => 'single',
'font' => 'Arial'
);
$docx->addText($text, $paramsText);
$docx->createDocx('test/example_text');
$docx->transformDocument('test/example_text.docx', 'test/example_text.pdf', null,array('debug'=> true));
?>
Log is as follows.
2014-12-08T11:24:44-08:00 phpdocx_logger INFO Set language: en-US
2014-12-08T11:24:44-08:00 phpdocx_logger INFO Enable compatibility mode.
2014-12-08T11:24:44-08:00 phpdocx_logger INFO Add text to word document.
2014-12-08T11:24:44-08:00 phpdocx_logger INFO Set DOCX name to: test/example_text.
2014-12-08T11:24:44-08:00 phpdocx_logger INFO Set DOCX name to: test/example_text.
2014-12-08T11:24:44-08:00 phpdocx_logger INFO Remove existing template tags.
2014-12-08T11:24:44-08:00 phpdocx_logger INFO Add word/document.xml content to DOCX file.
2014-12-08T11:24:44-08:00 phpdocx_logger INFO Close ZIP file
2014-12-08T11:24:44-08:00 phpdocx_logger INFO Copy DOCX file using a new name.
Results of Check.php as follows:
PHP_VERSION: 5.4.24
PHP_OS: Darwin
PHP_UNAME: Darwin dscfmserver.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
SERVER_NAME: client.dalescott.com
SERVER_SOFTWARE: Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/0.9.8za
SERVER_ADDR: 192.168.40.7
SERVER_PROTOCOL: HTTP/1.1
HTTP_HOST: client.dalescott.com
HTTP_X_FORWARDED_FOR:
PHP_SELF: /phpdocx/check.php
XSLTProcessor: 1
ZipArchive: 1
DomDocument: 1
SimpleXMLElement: 1
Tidy: 1
Getting a little more urgent to resolve this.
Thanks
Jonathan
Hello,
Please run transformDocument using the CLI mode and enabling the debug mode in this method, not in the phpdocx config file.
About your OS, as you're using a Mac OS X you can't use OdfConverter, you'll need to disable it through in transformDocument.
And your log returns this error:
--------------------------------------------------------------------------
No such file or directory No Java runtime present, requesting install
--------------------------------------------------------------------------
Did you install Java?
Regards.
Hello,
Sorry for this question: Please explain how to use CLI, as requested.
Thanks
Hello,
Please read the available PHP documentation on:
http://php.net/manual/en/features.commandline.php
It's as simple as run the php command directly;
$ php sample_1.php
Regards.
Here is transcript:
1Exit-445-MacBookPro-Retina-3:phpdocx jonathan$ php test.php
sh: /www/sites/dalescott.com/phpdocx-corporate-4.1/classes: is a directory
Dec 24, 2014 12:14:05 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection connect
INFO: connected
Dec 24, 2014 12:14:05 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection disposing
INFO: disconnected
Exception in thread "main" java.lang.IllegalArgumentException: inputFile doesn't exist: /var/tmp/tempOdt_549b1e8db3ec5.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)
1Exit-445-MacBookPro-Retina-3:phpdocx jonathan$
Hello,
Did you disable OdfConverter when you do the transformation? As you're using Mac OS X you can't use it.
Regards.
Hello,
Still trying to restore Transform function after migrating to new server.
Current status: seeing this error when running sample.php from the command line.:
Unable to access jarfile /Library/FileMaker
For reference, this IS a server running FileMaker Server 13 on Mac OS 10.9. But, there is no "Library/FileMaker" directory. FileMaker Server installs Java, but on first running sample.php, the system would prompt to install JRE 6. After agreeing to install, the error changed to the one above.
Running out of time to troubleshoot this on my own. How to I get one-on-one tech support?
Thanks
Edited by admin ·
29-12-2014 - 08:25 Hello,
Please send an email using this contact form:
http://www.phpdocx.com/contact
Regards.