cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Related to Button widget

karthik2
7-Bedrock

Related to Button widget

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

ACCEPTED SOLUTION

Accepted Solutions

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 

View solution in original post

3 REPLIES 3

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 

slangley
23-Emerald II
(To:karthik2)

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

Announcements


Top Tags