Hi,
Is it possible with scripting to open up specific files in THE PDF viewer based a on a tag value? If so, how should I go about doing this?
Thanks for your hlep.
Tag to Open File in PDF Viewer
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Tag to Open File in PDF Viewer
You can fire the code below when a tag value changes for example. Or when a tag value is a specific value. You can use the ValueChange event found in the lower left corner of the Tags tab, called Script.
Code: Select all
void Button1_Click(System.Object sender, System.EventArgs e)
{
this.PDFViewer1.FileName = "C:\\MyDir\\WherePDFsAre\\adp3_manual.pdf";
}
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Re: Tag to Open File in PDF Viewer
Thanks Mark! Just in case, is it also possible to specify a page number with it?
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Tag to Open File in PDF Viewer
Yes you can. Just use the auto-complete feature in C# to list the available functions on the PDFViewer Object.
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Re: Tag to Open File in PDF Viewer
What's the full path on the device its self? I'm getting an error at runtime where it can't find the file but I've put it in every possible location. It's getting installed (you can browse manually and find it using the open button) but I can't figure out the path.
I've even tried just setting at compile time using the drop down menu but that doesn't work either. When the screen loads i get an error that it can't find the file.
I've even tried just setting at compile time using the drop down menu but that doesn't work either. When the screen loads i get an error that it can't find the file.
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Tag to Open File in PDF Viewer
If you are using a HMI that runs WinCE, then it will not have any drive letters and the "C:\" path is not valid. Paths that start with "C:\" are only valid when your iX project runs on a PC. You can take a look at this forum post and it talks a little about paths. There are lots of posts about paths on this forum.
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer