How to embed and display a PDF file attached to a case within the screen

I am not sure how to display a link to a PDF file that is attached to a case within the screen.
The assumptions and the extent of my investigation so far are as follows.

I was able to identify the URL that the PDF link navigates to. However, when I tried to use that URL by placing an Image component in a section and setting the URL there, the PDF was not displayed, and I am currently stuck at this point.

This is my first post, and the English text was translated using Copilot, so I apologize if there are any parts that are difficult to read.
I would really appreciate it if you could share any useful information or insights.

Prerequisites

  • The UI theme in use is Theme Cosmos.

  • PDF files are attached to the case using the standard activity pxLinkAttachmentToCase, and the attachments are inherited from a pre-processing case.


Findings so far

  • Based on the behavior observed using the browser’s developer tools, we identified that the URL to open the attached PDF file can be constructed as follows:

Plain Text

pxRequestor.pxReqContextURI + “/” +

pxRequestor.pxReqServletNameReal +

pxRequestor.pxReqPathInfoReal +

“?pyActivity=pzRunActionWrapper” +

“&linkInsHandle=” + pyWorkPage.pyCaseRelatedContent(1).pzInsKey +

“&pzActivity=Work-.GetAttachmentReference” +

“&skipReturnResponse=true” +

“&pySubAction=runAct” +

“&viewInline=true” +

“&viewPDFInline=true” +

“&fileName=” + pyWorkPage.pyCaseRelatedContent(1).pyMemo

  • When this URL is set on an Image component placed in a section, the PDF is not displayed inline.

  • When the same URL is configured on a Button with the click action “Open URL in Window”, clicking the button successfully opens the PDF content in a separate browser window.

    • Based on this behavior, we assume that the URL itself is valid and working as expected.

In my opinion, your URL looks correct and is working as expected since it opens in a new window. The issue seems to be with the Image component, as it doesn’t support rendering PDFs (only image types).

What you can try:

  • Use an iframe inside an HTML section to display the PDF inline

  • Or use a button/link to open it in a modal or new window if inline is not mandatory

1 Like

Thank you very much. I will consider the approach you kindly suggested. It was extremely helpful.

I would like to share only the outcome of what we tried.
In conclusion, we decided to adopt the alternative approach of displaying the content in a separate window.
We did attempt to use an iframe, but it could not be displayed due to a 400 error. We suspect this is most likely restricted by security settings.
Although this was a disappointing result, we believe it was still valuable to gain this insight.
It may be a challenging request, but we hope this functionality will be provided as a standard component in the future.

1 Like

I would like to correct my previous statement due to inaccurate information.
The issue was simply an incorrect way of passing property values in the HTML source.
After correcting this, I was able to successfully embed the content using an iframe.
I referred to the following post for guidance:

1 Like