Question
2
Replies
414
Views
Posted: November 26, 2019
Last activity: November 27, 2019
Closed
How to display PDF in Section?
Hello guys,
I want to display a Pdf document in a section as a part of not in another window.
The pdf is in the server, it must display in the section
Can you please share with me how to? steps from the begining. I am new, I have just started working with PEGA.
Regards;
Hasnaa
***Moderator Edit-Vidyaranjan: Updated Platform Capability***
Hi Hasnaa,
Kindly see the below steps which might be of some help.
This describes how to display a PDF/Image/Video within a harness.
Here is the list of components required.
1. Property: ContentsURL. The property holds the URL value of the source contents.
2. Custom control: IFrameViewer. The control displays the contents using iframe.
<%
String srcURL = tools.getActive().getStringValue();
if ("".equals(srcURL)){
srcURL = "./webwb/blankimage.png";
}
String sWidth = StringUtils.crossScriptingFilter(tools.getParamValue("width"));
if ("".equals(sWidth)) {
sWidth = "400";
}
String sHeight = StringUtils.crossScriptingFilter(tools.getParamValue("height"));
if ("".equals(sHeight)) {
sHeight = "700";
}
%>
<iframe width="<%=sWidth%>" height="<%=sHeight%>" src="<%=srcURL%>" allowfullscreen="false"></iframe>
3. Section: ContentsViewer. The section displays the contents inside a harness.
Configuration details of ContentViewer section.
Steps to test.
1. Embed the section ContentsViewer into a section then navigate to the section.
2. Specify the URL of the source content in the "Contents URL" text input.
3. Click "Update URL" button.
Regards,