We are using ColdFusion MX7.
The CFDOCUMENT tag uses iText for the PDF creation so the whole of the iText library is included in the standard CF deployment.
The problem I’m having is that I want to use a version of iText that is newer than the one included in CF7. I need to keep CFDOCUMENT functioning, so simply changing the jar file is not an option.
What I have done so far is to load the iText source into Eclipse and refactor it to a different name. That works fine and has been doing so for about a year.
However, I would like to upgraded to the newest iText release, and jumping through the hoops of refactoring again is a bit daunting.
Is there an easier way to load the jars and not have them conflict with the old version?
One option is to use the JavaLoader.cfc to load a newer version of the jar. Since it uses an external classloader it can be used without disturbing the existing version.
http://www.transfer-orm.com/?action=javaloader.index
http://javaloader.riaforge.org/
However, it would still require rewriting your createObject(“java”, “path.to.class”) statements to use javaLoader.create(“path.to.class”) instead. But in the long run, that might be better than refactoring, because it would be easier to update the iText jar in the future.