Support Article
Word Document to PDF Conversion issue
SA-40774
Summary
Error when generating a PDF without populating the content of a Word document using the ConvertAttachmentToPDF flow action.
Error Messages
Failed to load PDF document
Steps to Reproduce
Include a Word document as an attachment for a work object using the out-of-the-box ConvertAttachmentToPDF flow action.
Root Cause
A defect in Pegasystems’ code or rules.
The strFileSource was not parsed in the HTML document.
Resolution
Perform the following local-change:
- Declare strFileSource in the ActionConvertAttachmentToPDF HTML -
<input id="strFileSource" name="strFileSource" type="hidden" value="<pega:reference name='Param.strFileSource'/>"> - Add the below line to the ConvertToPdf() function present in the ActionConvertAttachmentToPDF HTML Source (JSP)
document.getElementById('strFileSource').value = sResult; - Remove the Span tag for the error handling in the Object tag:
Code after the span tags removal must be :
<object classid="CLSID:ABA23149-06BA-440D-88FF-69203B966083" codeType=application/x-oleobject id="OpenAuthor" style="visibility:hidden" viewastext>
PARAM NAME="_ExtentX" VALUE="0">
<PARAM NAME="_ExtentY" VALUE="0">
</object>
Published November 8, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.