Any ColdFusion/OpenOffice Gurus?

Posted By : todd sharp Posted At : June 21, 2008 8:52 AM Posted In: ColdFusion

15

I'm abusing the blog a bit here by asking a question, but are there any folks with experience integrating OpenOffice with CF out there? I'm really looking for a basic quick start guide for getting started. What do I need installed on the server?

I did some quick tests last night but couldn't even get past creating the bootstrap object to connect to OO. In my first attempt tried using JavaLoader to load up the OO jars, but got an 'no office executable found' exception. I then figured I'd try adding OpenOffice to my class path, but the connection just timed out.

Can anyone point me in the right direction?

Comments (15)

Mike Kelp's Gravatar While I have no experience with this, I was interested by your idea and did some assitive googling :-)

Checkout this link:
http://www.javaworld.com/javaworld/jw-05-2008/jw-0...

It seems to show how to manipulate a spreadsheet using Java and explains a bit more about how OO.org can run in a server mode and manipulate many documents via network communication (regardless of language). Though, since many of them are written in Java, and CF has the capability, using the jar straight up might be preferred.

Anyway, hope that helps and good luck.

Scott P's Gravatar Todd - not sure but you might look at this:

http://www.artofsolving.com/opensource/jodconverte...

todd sharp's Gravatar @Scott - yeah dude, that is what I'm talking about....perfect!! And it works too ;)

Scott P's Gravatar Yeah - I've been playing with it also. I'll try to ping you tomorrow.

Mike Kelp's Gravatar Good find Todd!

If you get a chance, I'd love to see a sample of what you do with it.

todd sharp's Gravatar @Mike: I'll probably post something once I get things polished.

@Scott: Did you have any luck getting CF to start OpenOffice as a service? I'm trying to use cfexecute with no luck whatsoever...

Scott P's Gravatar yeah - try cmd.exe with /k and the cmdline as argument.

<cfexecute
name="cmd.exe"
arguments="/k c:/pathto/soffice -headless -accept=""socket,host=127.0.0.1,port=8100;urp;"" -nofirststartwizard" />

todd sharp's Gravatar Still no luck :(

I think it's choking because my pathto/soffice has spaces in it - and wrapping in quotes doesn't work...

Scott P's Gravatar <cfexecute
arguments="-headless -accept=""socket,host=127.0.0.1,port=8100;urp;"" -nofirststartwizard"
name="C:\Progra~1\OpenOf~1.0\program\soffice"/>


dir /x from the cmdline should tell you the 8.3 directory name if the one above is wrong.

todd sharp's Gravatar You are my hero :)

When dealing with me, always remember, if it ain't GUI, I don't have a clue :)

Juan Escalada's Gravatar I´ve been asked to extract every single footnote on a word document and its related paragraph one by one. After the pair (the particular footnote and the related paragraph) is extracted they want to send it via e-mail to a person. Does anyone know if I could do this with JOD Converter?

Thanks in advance, Juan.

todd sharp's Gravatar I haven't messed with JOD+Word at all - but I'd be willing to bet you could do that with Apache POI Juan.

Dan Z's Gravatar I've been using OpenOffice with CF for a few years now.. I use JavaLoader along with artofsolving's guide to setup OO as a service.

You can really do some great stuff with it. I'm using it now to create .swf clickable previews of user uploaded Power Point presentations.

Seth Johnson's Gravatar I was finding that if Open Office was not running on the first attempt ColdFusion would throw an error: "Could not determine OpenOffice installation." On the second conversion attempt everyhting would work. I ended up taking your CFEXECUTE code and running that before the CFDOCUMENT in order to make certain OO is up and running. Do you think I should then use CFEXECUTE to exit OO after the conversion? I tried to find a command line option, but soffice doesn't seem to have an "exit" or "quit" switch.

Thanks!

Andy G's Gravatar OMG, I have been rackin' my brain for about 2 days now on this. finally found this article and it solved my problems. Just had to move my macro over to the "C:\Program Files (x86)\OpenOffice.org 3\Basis\share\basic\" (and pick one folder) to place it.

Thank you all!