Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi,
I am having the requirement like this.
I am having the pdf file with me.I want to create one button for that pdf.whenever i click on that button beside that i want that pdf file.I already tried this with button but pdf is embedded in button it wont displays
Thanks,
karthik
Solved! Go to Solution.
If you want the PDF to be displayed in the same mashup beside the button, follow the article to use a WebFrame, as mentioned in the above post.
If you want to open PDF in a new window or download it, then you can use a Link widget. Set its visible property to false. Bind the Clicked event of button to the Navigate property of the Link widget and specify the URL to the PDF directly in the LinkURL property or bind a value to it using a service.
If the PDF is available in a TWX FileRepository, then
1. Use below URL format if you want to open PDF in a browser window
https://[TWX_HOST]:[TWX_PORT]/Thingworx/FileRepositoryDownloader?download-repository=[REPOSITORY_THING_NAME]&directRender=true&download-path=[PATH_TO_FILE].pdf
2. Use below URL format if you want to download PDF upon clicking button
https://[TWX_HOST]:[TWX_PORT]/Thingworx/FileRepositories/[REPOSITORY_THING_NAME]/[PATH_TO_FILE].pdf
you can try following this:
https://www.ptc.com/en/support/article/CS214032?&posno=2&q=show%20pdf%20thingworx&source=search
If you want the PDF to be displayed in the same mashup beside the button, follow the article to use a WebFrame, as mentioned in the above post.
If you want to open PDF in a new window or download it, then you can use a Link widget. Set its visible property to false. Bind the Clicked event of button to the Navigate property of the Link widget and specify the URL to the PDF directly in the LinkURL property or bind a value to it using a service.
If the PDF is available in a TWX FileRepository, then
1. Use below URL format if you want to open PDF in a browser window
https://[TWX_HOST]:[TWX_PORT]/Thingworx/FileRepositoryDownloader?download-repository=[REPOSITORY_THING_NAME]&directRender=true&download-path=[PATH_TO_FILE].pdf
2. Use below URL format if you want to download PDF upon clicking button
https://[TWX_HOST]:[TWX_PORT]/Thingworx/FileRepositories/[REPOSITORY_THING_NAME]/[PATH_TO_FILE].pdf
Hi @karthik2.
If one of the previous responses allowed you to find a solution, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.
Thank you for participating in our community!
Regards.
--Sharon