Open PDF Files in WebClient
This tutorial describes how to open a PDF file from WebClient by using a custom template. This template uses the panel title as the URL to open the file. To implement this template, follow these steps:
- In Eclipse, create a custom template file called “FileViewer-page.wcli” in your CustomTemplates project.

- Copy one the following code snippets in your “FileViewer-page.wcli” file (the code you use will determine how the PDF file will open).
Code 1: Will open the file in a different window
/(!JSOnLoad)
window.open(/(!Panel:!Title), "_blank", "height=600,width=800");
/(!JSOnLoad)
Code 2: Will open the File inside the function panel that uses the template
/(!MainArea)
<embed src="/(!Panel:!Title)" width="100%" height="100%" />
/(!MainArea)
NOTE: You can see the results of using these code snippets in step 6.
In CA PLEX create the following functions:
FileViewer

PDF_Viewer

Open the Action Diagram for the “PDF_Viewer” function and add the following code in the “Pre Point Set Panel caption text”:
Cast Environment<*Message text>, Input

This will set the received URL as panel title for the function in order to open the file using the custom template we have created.
To open the PDF file, call the “PDF_Viewer” function. That this function requires the URL from the file as a parameter.



Generate your functions and test them in Eclipse.
Test using the “Code 1” from step 2


Test using the “Code 1” from step 2

Related Articles
iSeries Spool File and Operations Menu with WebClient
Object Location All Plex objects are scoped under the “iSeries Items” entity. If any changes need to be made, then these objects will need to be inherited from. Non-Plex Files To run these processes fully, you will need 3 files (Download the ZIP with ...
CM WebClient File Upload Setup
File Upload This guide will show you how to upload files to your Web Server from your WebClient application. 1. Import the attached zip Java Project into your Eclipse Workspace. NOTE: If your workspace uses a Tomcat 10 server, make sure to use the ...
Patch Build to CM WebClient 1.8.8
Latest Version: Date 09/02/2025 WebClient-1.8.9-pre13624 NOTE : If the hightail link doesn't open correctly the first time, please just reload the screen, we recommend using the Chrome browser to open it. IMPORTANT: The latest eclipse plugin ...
CM WebClient 1.8.8 Release Notes
Download current GA Release : Download CM WebClient 1.8.8 WebClient Mobile Updates To see the latest updates of WebClient Mobile, please visit: WebClient Mobile repository. What's New? Support Java 11 Complete functionality of DojoTimePicker.ctrl to ...
Generate the Full URL for Uploaded Files on a Server
Most commonly when you save a file in your server you will be using a context name to define the physical location in which the files are stored and also you may be using the same context name for the file paths in your database records, see the ...