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

Using Web Frame widget for Excel/PDF preview.

svisveswaraiya
17-Peridot

Using Web Frame widget for Excel/PDF preview.

Hi,

How can I preview using web frame widget, the excel file that I browse and upload in a grid?

And How can I do the same for PDF file?

 

Thanks in advance,

Shalini V.

8 REPLIES 8

Hello Shalini,

 

Thank you for posting to the ThingWorx Developer section of the PTC Community.

 

In doing some research regarding your request I have found that it should be possible to load a PDF via a webframe provided the PDF is in a ThingWorx Repository.

 

You would simply need to set the Input URL for the Webframe Widget to something like the following: http://<host:port>/Thingworx/FileRepositoryDownloader?download-repository=<YourThingWorxRepository>&directRender=true&download-path=/your_pdf.pdf

 

With respect to Excel or other Office documents specifically we do not have anything out of the box that would allow a preview of these files on a mashup. This may be possible with some sort of customization but I cannot speculate on how this would be accomplished.

 

As you may have noticed when Office files are accessed in Web Browsers they are always presented to be downloaded prior to opening. This is typically for security purposes given that macros or other malicious code can be encapsulated in these files.

 

Hopefully this helps.

 

Regards,

Tyler Misner

Technical Support Engineer

Hi tmisner,

Thanks for your response. Based on your inputs I have given the port number and TW repository to be system repository (folder inside the ThingWorxStorage folder). Is this right? And for pdf file what if I need to browse the path and then preview it without directly giving the pdf name?


http://localhost:8089/Thingworx/FileRepositoryDownloader?download-repository=SystemRepository&directRender=true&download-path=/your_pdf.pdf

Hello again svisveswaraiya,

 

This would seem to be correct. Have you tested accessing that URL after setting it?

 

Can you clarify further what you mean by "And for pdf file what if I need to browse the path and then preview it without directly giving the pdf name?"

 

Are you asking about how you could link to the PDF without displaying the full link? Clarification is needed here.

 

Regards,

Tyler Misner

Technical Support Engineer


Hi misner,

I gave the link and its working fine. 

 

To clarify my question, Using the file upload widget, I need to browse the path where many pdf files are located and when I choose one, the chosen pdf should be previewed in webframe widget. Is that possible?

 

Thanks, 

Shalini V.

Hello Shalini,

 

I do apologize for the delay in getting back to you here but I have been working on this internally.

 

Could you please have a look at the attached screenshot and confirm this is the functionality you are looking for?

 

If this is the case, I can put together a KCS article that documents the steps I followed to achieve this.

 

Regards,

Tyler Misner

Technical Support Engineer

 Hi tmisner,

That's okay.

 

I am looking for something like the attached png. Using File upload widget I am trying to browse and upload the pdf and preview it using web frame widget.

 

Thanks,

Shalini V.PreviewFile.png

Hello Shalini,

 

Let me work on this and get back to you. We will need to configure a custom service to form the link correctly and then proceed to set it to the URL value of the web frame on Upload.

 

Regards,

Tyler Misner

Technical Support Engineer

Hello again Shalini,

 

Please see the following article which I have created to document this functionality:

https://www.ptc.com/en/support/article?n=CS303287

 

Hopefully it meets your requirements. If something needs to be changed or updated please let me know.

 

Regards,

Tyler Misner

Technical Support Engineer

Announcements