|
| |||||||||
| Tags: command line, documentconverterpy, exec, windows xp |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Can't convert documents in Php script (via command line)
Hello Guys, I have a quick question. I am using DocumentConverter.py with OpenOffice 3 in a windows environment. When i used command prompt to convert documents everything works perfectly, with no problem. However, when I attempt to convert from PHP on a webserver via command line, using exec() - see below, everything goes through but no conversion occurs. So, for example, the soffice.exe is started (soffice.bin & soffice.exe) with NO problem. However, in the second line, no document conversion happens. I am hoping that this is something simple. I have tried everything but to no avail. I have tried all sorts of variations but with no success. I am on Windows XP. //Convert source to PDF... //Start Service exec('"c:\\Program Files\\OpenOffice.org 3\\program\\soffice.exe" -headless -nologo -norestore -accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager'); ----->THIS WORKS FINE //Convert File exec('"c:\\Program Files\\OpenOffice.org 3\\program\\python" c:/wamp/www/DocumentConverter.py xr2.doc xr2.pdf'); -------->THIS DOES NOT WORK: GIVES NO ERRORS BUT NO CONVERSION OCCURS Thanks |
|
#2
| ||||
| ||||
| Re: Can't convert documents in Php script (via command line)
I think you need to generate PDF files through php script, I will suggest you to a basic macro Java code for this. Just install a PDF printer such as PDFCreator for Windows and use -pt command with the the first argument as the printer name and the second argument as the source document. For example : Code: "C:\Program Files\OpenOffice.org2.4\program\soffice" -norestore -nofirststartwizard -nologo -headless -pt PDFCreator sample.ppt |
|
#3
| |||
| |||
| Re: Can't convert documents in Php script (via command line)
Hello Sam.D, First and foremost, thankyou for the prompt response. Unfortunately, I tried your suggestion but nothing happened. The soffice.exe and soffice.bin started, as they should have, but no PDF was produced and no error was given. I typed the following: "C:\Program Files\OpenOffice.org 3\program\soffice" -norestore -nofirststartwizard -nologo -headless -pt PDFCreator xr.doc Note: I located xr.doc is the program directory of OpenOffice. I also tried putting a copy in the PDFCreator base directory etc. But no results. Note that, as you can see, I am using the professional version of OpenOffice 3 (3.1 to be exact). I also installed PDFCreator in standard mode and in server mode but neither produced results. One more quick question. If I use this on my server in my network, and say two people attempt to convert documents at the same time, will this cause soffice to crash? I really appreciate any feed back. Thanks, Ethan-Anthony |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Can't convert documents in Php script (via command line)" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| xcopy command line together with wmplayer command line | Aislinn | Operating Systems | 5 | 31-03-2010 01:13 PM |
| PROBLEM: COMMAND LINE OPTION SYNTAX ERROR. TYPE COMMAND /? FOR HEL | FORTHELOVEOFGODPLEASEHELPME | MediaCenter | 3 | 03-09-2009 06:41 PM |
| Convert works documents to word documents | Arzaan | Tips & Tweaks | 3 | 04-03-2009 06:46 PM |
| Command line tool to convert VC project files to Makefile | Harman | Software Development | 3 | 25-10-2008 06:19 PM |
| autorun.inf - shell\..\command with command line parameter doesn'twork | kakii | Windows XP Support | 1 | 18-05-2007 02:24 AM |