Close popover
Bhattacharya Arka (ABHATTCHRYA)
Cognizant Technolgy Solutions

Cognizant Technolgy Solutions
ABHATTCHRYA Member since 2010 11 posts
Cognizant Technolgy Solutions
Posted: May 13, 2016
Last activity: May 18, 2016

PDF attachment is not loading intermittently

Hi All,

PRPC Version - 7.1.8

Adobe Acrobat Reader version - XI

We are facing an issue with loading attachment files [.pdf extension] on the browser intermittently. For this we had raised ‘ SR-A23772’ previously.

Our requirement is to show the attachments of a case in the middle of the screen [screen print attached for reference]. The attached zip file contains the steps to reproduce and pdf files used to test this issue. The issue here is the same pdf loads at times and fails to load on other occasions. While trying to debug the issue, we have found the following -

The pdfs are stored in the Pega application as Work object attachments and are being rendered on the screen using a customized control [attached file 'PDFViewer.txt' is the code for the control].

To render the PDF content, the control uses the following code -

    <object  id='pdfObject' data='<%=fileURL%>' width='100%' height='100%' type="application/pdf">
<embed  id='pdfEmbed' type='application/pdf'  width='100%' height='100%' src='<%=fileURL%>' mode="display" />    

Where fileURL = http://<DLLServerURL>:80/prweb/PRServlet?pyActivity=Work-.DisplayAttachFile&LinkedRefTo=<attachmentKey>

Sample attachmentKey can be DATA-WORKATTACH-FILE <DLLWorkPool> D-22!20160425T065220.284 GMT

Inside this activity ‘Work-.DisplayAttachFile’, the following code is used to open the attachment instance and load the pyAttachStrem property's content on the browser -

String strWorkObjectRef = tools.getParamValue("LinkedRefTo");
String sErrorMessage = tools.sendFile(strWorkObjectRef, "pyAttachStream", true, "pxAttachName", null, false, null, true);
if (sErrorMessage != null){
tools.getThread().getThreadPage().putString("pyXMLStream", sErrorMessage);

As per the initial analysis, it seems the sendFile method is not being consistent in returning the content which the browser can render. Thus the same PDF is failing to render at times and is rendered properly on other occasions.

The two PDF files attached with this discussion are mostly causing the issue. While analyzing we have also found that there was a security settings checkbox in Adobe Acrobat Reader which when unchecked the PDFs are opening for some team members. However, the issue remains unresolved for other team members even after following the same steps. It is also suggested that by upgrading the Adobe Acrobat Reader to the latest version can resolve the issue, however due to policy restrictions we have still not been able to check this.

We have also tried the following solutions but most of them did not work for us.

Please let us know your thoughts on if the issue can be a Pega Product issue as the sendFile method is returning null[indicating success] even when the PDF fails to render on the browser. Also, suggest if there can be anything else that we can do to address the issue.

Message was edited by: Marissa Rogers - added category

User Experience
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.