OpenOffice Word and Excel to PDF Conversion for Railo and Adobe ColdFusion

ColdFusion , Railo , Web Development Add comments

I recently had to come up with a solution for Word-to-PDF file conversions on a server that was running Railo.  After much searching and combining of various articles that I read, I decided to put together a simple CFC to make this easier for others (and reusable for me).  This CFC will convert any document format that can be opened with OpenOffice (including Word, Excel, Powerpoint) to PDF format.  While it was written and tested for Railo 3.2, it will work on ColdFusion 7 and 8.  It may also work on BlueDragon, but I do not have an installation of that to test with.  If you have ColdFusion 9, you don't need this CFC - you already have built-in PDF conversion.

This currently only works for Windows servers.  If anyone wants to help modify it for Linux-based servers please do so, and share the code here.  I will put it in the download and credit you as well.

The pieces needed...

  1. OpenOffice 3.3 - OpenOffice must be installed on the server that Railo (or your CFML engine) is running on.
  2. JODconverter 2.2 - This is a Java library for interacting with the OpenOffice API.  The JAR files for this need to be in your CFML engine's classpath (there is more about this in the readme.txt included in the download below).  
  3. oolib.cfc - This is the CFC that connects ColdFusion to JODconverter, and then to OpenOffice.

All of this is better explained in the download.

DOWNLOAD CODE AND SAMPLE FILES HERE

Note: I submitted this to RIAforge.org and should have it approved and available there soon as well.

1 response to “OpenOffice Word and Excel to PDF Conversion for Railo and Adobe ColdFusion”

  1. James Lamar Says:
    Nice! Thanks for sharing.

Leave a Reply

Leave this field empty:



Powered by Mango Blog. Design and Icons by N.Design Studio