Press ESC to close · Ctrl+K to open

View PDF files in WinCC

View PDF files in WinCC

In the following article, we will see how we can view PDF files within WinCC.

The first control we will use is already installed by default, which is the WinCC WebBrowser Control. Here we just need to define the file path in the MyPage property and that's it.

 

Once in Runtime, it loads the page defined in the MyPage property and opens the PDF document.

Now we would include the details of wanting to display the navigation bar, etc...

 

Continuing with the ActiveX controls, we can install Acrobat Reader, which has its ActiveX control, and as an alternative, we can also use Foxit Reader, which after installation also provides the FoxitReaderBrowserAx.dll Control, as can be seen in the following image.

 

Once selected to be available in WinCC, like any other control, we select it and insert it into our screen.

 

This control by default does not have any property to define which file we want to open. The src property does not work. Therefore, we will resort to VBScript for this.

 

We will use a button to open the document, but if we want the document to open when the screen is opened, we would use the Open event of the screen itself, to reference our object and open the document.

The code would be as follows to open it either directly when the screen opens or via the button.

We use the OpenFile(Path) method

 

Once in Runtime, after pressing the button, we have our document.

 

11-02-2019