Question

Ernst & Young LLP
IN
Last activity: 20 Nov 2020 4:07 EST
Conversion from Word to PDF using Doxc4j in Pega 8.4.1
Hi Team,
Have referred the below pega community link to convert word document to PDF.
https://collaborate.pega.com/discussion/convert-docx-word-document-pdf-81-and-above
Have imported all the reference jars that are mentioned but still the code is breaking after the first line.
try { java.io.InputStream doc = new java.io.FileInputStream(new java.io.File("C:/PRPCPersonalEdition/temp/Sample.docx")); tools.putParamValue("Check1","111"); org.docx4j.openpackaging.packages.WordprocessingMLPackage wordPackage = org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(doc); tools.putParamValue("Check5","555"); java.io.OutputStream outDoc=new java.io.FileOutputStream(new java.io.File("C:/PRPCPersonalEdition/temp/test.pdf")); tools.putParamValue("Check2","222"); org.docx4j.Docx4J.toPDF(wordPackage, outDoc); tools.putParamValue("Check3","333"); } catch(Exception e){ tools.putParamValue("Check4","444"); } }
It is moving after first line to Catch block therefore Check1 and Check 4 are coming in Parameter page.
Any leads were are we going wrong.