Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--- omit the DOM4J jar --->
- <cfset paths = []>
- <cfset arrayAppend(paths, "c:/path/to/poi38/poi-3.8-20120326.jar")>
- <cfset arrayAppend(paths, "c:/path/to/poi38/poi-ooxml-3.8-20120326.jar")>
- <cfset arrayAppend(paths, "c:/path/to/poi38/poi-ooxml-schemas-3.8-20120326.jar")>
- <cfset arrayAppend(paths, "c:/path/to/poi38/poi-scratchpad-3.8-20120326.jar")>
- <cfset arrayAppend(paths, "c:/path/to/poi38/ooxml-lib/stax-api-1.0.1.jar")>
- <cfset arrayAppend(paths, "c:/path/to/poi38/ooxml-lib/xmlbeans-2.3.0.jar")>
- <!--- set loadColdFusionClassPath=true so we can use CF's version of DOM4J --->
- <cfset javaloader = createObject("component", "javaloader.JavaLoader").init(loadPaths=paths, loadColdFusionClassPath=true)>
- <!--- load DOCX file --->
- <cfset pathToFile = "c:/path/to/someFile.docx">
- <cfset fis = createObject("java","java.io.FileInputStream").init( pathToFile )>
- <cfset XWPFDocument = javaloader.create("org.apache.poi.xwpf.usermodel.XWPFDocument")>
- <cfset poiFile = XWPFDocument.init( fis )>
- <cfdump var="#poiFile#" label="It worked!">
Advertisement
Add Comment
Please, Sign In to add comment