64 Bit ColdFusion with 32 Bit Open Office

If you’re running a 64 bit ColdFusion installation and want to use cfdocument to convert Word, Excel, or PowerPoint files to PDF you may encounter an issue with an incompatibility between the 64 bit dll for ColdFusion and the 32 bit dll for Open Office. Java can’t load and run them both to work together. The good news is that there is a workaround for this issue. You’re going to need to:

  1. Download the latest version of Open Office from openoffice.org to your server and install it (you can use the default locations during the installation).
  2. Download the Non Sucking Service Manager (NSSM) from nssm.cc and simply save it into a convenient folder – no installation needed.
  3. You will then create a new service by opening a command prompt and going to the folder where you put nssm
    1. If you saved nssm into the C:\nssm folder then you could enter ‘cd /nssm’
  4. Once in the folder you will type ‘nssm install openoffice_server’ – you can replace openoffice_server with any other name you want to use for running Open Office as a Windows service
  5. This will then launch the GUI for NSSM where you can add arguments and set some useful options for the service
    1. On the Application tab choose the path to your Open Office program in the Program Files or wherever else you chose to install it. e.g.e Path of C:\Program Files (x86)\OpenOffice 4\program\soffice.exe and Startup Directory of C:\Program Files (x86)\OpenOffice 4\program
    2. On the Application tab in the Arguments field enter:  -nologo -nodefault -norestore -nofirststartwizard -headless -accept=”socket,host=,port=8900;urp;StarOffice.ServiceManager”
    3. On the Details tab choose Startup Type of Automatic (Delayed Start) – this will stagger the service startups so Open Office fires up right after more critical ones like ColdFusion itself.
    4. In the I/O tab you can set the Output and Error paths to C:\nssm\output-office.txt
    5. On the File rotation tab you’ll want to check all the boxes and enter 86400 seconds and 0 bytes for the options.
    6. Save your Service and then you can check that it is running in your Services in the Windows Control Panel – if it’s not go ahead and Start the service.
  6. Login to your ColdFusion Administrator web interface and go to Server Settings > Document in the left navigation.
    1. Then you need to choose the Open Office Directory, e.g. C:/Program Files (x86)/OpenOffice 4/ and hit the Add button to save.
    2. Under Configure remote OpenOffice with ColdFusion enter for the Remote Host and 8900 for the Remote Port and hit the Add button to save.

You should now be able to connect to the open office service on your localhost when using cfdocument.

Kevin Hall

Kevin Hall

I am one of the owners of Infinite Web Design. I'll be glad to talk with you about who we are, what we do, or any of the topics we write about here.
Kevin Hall

Latest posts by Kevin Hall (see all)