Thursday, July 16, 2009

CF9 Beta: CFDOCUMENT + OpenOffice Can Convert Any Format to PDF? (Documents,RTF's and Excel Sheets .. oo.Oh!)

Okay, that is definitely an exaggeration. But I have been testing <cfdocument format="pdf" ..> with an OpenOffice 3 installation and was quite pleased to discover it seems like it can convert any format to pdf. Well, any format OpenOffice can convert.

The current version of the CF9 documentation is probably not as clear on this topic as it could be. So I did some poking around. In my initial tests I was able to use CFDocument to convert most Office formats to pdf, just by changing the srcfilevalue. Though I have not tested all of the 2007 formats yet, here are my results so far:

CFDOCUMENT Format="PDF"

Format | Succeeds Yes/No | (Notes)
--------------------------------------
XLS | OpenOffice=Yes | POI=No
XLSX | OpenOffice=Yes | POI=No
DOC | OpenOffice=Yes | POI=No (As documented)
DOCX | OpenOffice=Yes | POI=No (As documented)
PPT | OpenOffice=Yes | POI=Yes
RTF | OpenOffice=Yes | POI=No (This is implied by documentation for .doc)
VSD | OpenOffice=Yes | POI=Semi (No exception, but generated pdf is gibberish)

Overall, the binary formats (.doc, .xls, ...) seemed to be handled a bit better. There were a few formatting issues with some of the more exotic documents I tested, as mentioned here. But since I received the same results using OpenOffice directly, it suggests the issue is with OpenOffice.

My assumption would be that conversion requests from CFDocument are just passed from CF to OpenOffice. So if OpenOffice knows how to do the conversion, the request works. I will probably submit a bug/enhancement request in the public bug database to ask if they can clarify the full range of supported formats in the documentation. There are also a few open and known issues. So if you encounter any issues with the OpenOffice integration, make sure you check the release notes and bug database first.

2 comments:

Jorge Rozas October 29, 2009 at 8:34 AM  

Hi

Is it posible to join or bind multiple word documents or convert the word documents in pdf and then bind them.

Many Thanks

Jorge R.

cfSearching October 29, 2009 at 1:19 PM  

@Jorge,

IIRC, I do not believe cfdocument supports the conversion of multiple documents. So you would need to convert the documents one at a time. Then merge the resulting pdf's with <cfpdf action="merge"..>.

-Leigh

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Header image adapted from atomicjeep