The code inside the Java Step is intended to convert an attachment of .docx format into .pdf format before appending it to an existing PDF. I do this by taking the bytes of both the existing PDF and the .docx attachment, using DocX4J to convert the .docx bytes into .pdf bytes, then using PDFBox to merge the new PDF bytes into the existing PDF bytes. I have included a text file showing the exact lines used.
Recently, this functionality has stopped working. Checking the logs shows that DocX4JExceptions are being thrown. I have attached a second text file with a copy of the stack trace associated with this exception.
Has anyone successfully implemented this functionality in the past with Pega 8.1.4/DocX4J 6.1.1? Any insight as to what's gone wrong and how to fix it would be greatly appreciated.
Further investigation has led me to believe this is an issue with Pega 8.1.4's implementation of DocX4J. Going off the stack trace, we can find that the issue has something to do with the ObfuscatedFontPart class's tmpFontDir variable being initialized as null.
I've run diagnostics in our Pega environment, and this "tmpFontDir" variable is pointing towards a file located in "/home/tomcat/.docx4all/temporary embedded fonts." This filepath is likely not a valid one, which is why the tmpFontDir file is unable to be located and thus throws the resulting error.
Can anyone provide insight as far as where to go from here? I've filed a support ticket with Pega through MSP, and will update this thread once more if and when a solution is implemented successfully.