Applies To:
  • CitectSCADA 5.xx, 6.xx, 7.00
  • CitectHMI 5.xx, 6.xx, 7.00

Summary:
I am using the Microsoft Web Browser ActiveX control to display PDF documents on my CitectSCADA pages. Can I customise the way PDF documents are displayed?
 

Solution:
Yes you can. Adobe Acrobat Reader has Open Parameters which can be appended to the file path to customise how an actual PDF file is displayed when opened. The Open Parameters are appended to the file path in the following format:

<File Path>#parameter1=X&parameter2=Y&parameter3=Z

For example, let’s say that you have a PDF document called manual.pdf which is located in your C: drive. Let’s also say that you want to go straight to page 3 in that document every time it loads, and have it zoomed at 150%. Below is the format of the path including the open parameters that you would pass as the string URL value for the Web Browser object:

C:\manual.pdf#page=3&zoom=150

Your Cicode function that calls this document could look like the one below:

FUNCTION
OpenPDFManual(
STRING sObjectName)

    OBJECT
oWebBrowser = ObjectByName(sObjectName);
    STRING
sURL = "C:\manual.pdf#page=3&zoom=150";
    _ObjectCallMethod(oWebBrowser,
"Navigate2", sURL, "", "", "", "");
END

Note: This article assumes that you already have an understanding of how to use the Microsoft Web Browser ActiveX object and the ActiveX Cicode functions within CitectSCADA. If you haven’t used these before, please refer to Knowledgebase Articles Q2986 and Q3237 as well as the ‘Cicode Programming Reference’ > ‘Cicode Function Categories’ > ‘ActiveX Functions’ section located in the CitectSCADA Help.

 

Keywords:
PDF, Microsoft Web Browser, ActiveX, Open Parameters  

Attachments