Question

1
Replies
1021
Views
ABHATTCHRYA Member since 2010 11 posts
Cognizant Technolgy Solutions
Posted: May 13, 2016
Last activity: May 18, 2016
Closed

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" />    
</object>

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

Sample attachmentKey can beDATA-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);
pega.terminateActivity();}

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.

http://stackoverflow.com/questions/21319484/pdf-embedded-in-object-or-embed-tag-not-loading-in-ie-11

http://stackoverflow.com/questions/7588262/pdf-files-do-not-open-in-internet-explorer-with-adobe-reader-10-0-users-get-an

https://forums.adobe.com/thread/948648

https://forums.adobe.com/message/3305681#3305681
http://answers.microsoft.com/en-us/ie/forum/ie11-windows_7/internet-explorer-11-wont-display-embedded-pdfs/9c695a80-264b-4253-a08d-08ffc1a17500?auth=1

https://forums.adobe.com/thread/771034

https://helpx.adobe.com/reader/using/protected-mode-windows.html

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 Interface
Moderation Team has archived post
Share this page LinkedIn