Skip to main content
1-Visitor
January 18, 2017
Solved

How to open a PDF file in thinworx studio using button?

  • January 18, 2017
  • 1 reply
  • 5057 views

I am developing my own experience in thingworx studio. I have attached some buttons for opening some documents and videos using JS code in the home.js file by providing the links of the videos and the documents. Now I am trying to open a pdf file using the same procedure. While previewing the experience, the PDF file is opening, but after publishing when I am trying to open that from my tab, it's showing a white page.I have adobe reader installed in my tab. Is there any procedure I can use to open a PDF file in thingworx studio using buttons?

Best answer by mvonhasselbach

As Giri proposed: you can add a Hyperlink widget and point the link to a URL of a pdf. Worked for me - just tried it with the following URL: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

I didn't try it yet - you can check if you can find a way to programmatically invoke (click) the Hyperlink widget from your button click. Or you can try to change the style of the hyperlink so that it looks like a button.

1 reply

5-Regular Member
January 20, 2017

I doubt if accessing pdf from the canvas is allowed. You can redirect the Button click to an url of that pdf file. Or else, as a workaround, you can try converting the pdf page into an image and display it in the View canvas.

-Giri

dsengupta1-VisitorAuthor
1-Visitor
January 23, 2017

Thanx giri for your reply. I have tried using button click. It's not working. And making the pdf into an image won't be encouraged in my project. Please let me know if there is any other way to achieve the task..

Thank you

12-Amethyst
January 25, 2017

As Giri proposed: you can add a Hyperlink widget and point the link to a URL of a pdf. Worked for me - just tried it with the following URL: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

I didn't try it yet - you can check if you can find a way to programmatically invoke (click) the Hyperlink widget from your button click. Or you can try to change the style of the hyperlink so that it looks like a button.