Thank you for being a valued client of CM First Group. If you have any technical issues or concerns, please open a ticket on support.cmfirstgroup.com, email CM First technical support at support@cmfirstgroup.com or call us on our 24/7 customer hotline at +1 (512) 623-7586.

Follow

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:

  1. In Eclipse, create a custom template file called “FileViewer-page.wcli” in your CustomTemplates project.

  1. 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.

  1. In CA PLEX create the following functions:

FileViewer

PDF_Viewer

  1. 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.

  1. To open the PDF file, call the “PDF_Viewer” function. That this function requires the URL from the file as a parameter.

  1. Generate your functions and test them in Eclipse.

Test using the “Code 1” from step 2

Test using the “Code 1” from step 2

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk