cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver III
Resolver III

Does the PDF Viewer work at all?

Hello, I've been trying to make an editor in Power Apps for users to be able to update meta data on files whilest being able to view them; nearly everything works currently. nearly because i can't get any pdf to be displayed in the pdf-viewer.

 

At first I had been trying to convert docx files from my sharepoint environment to pdf to be viewed but never got any result so I decided to test if the pdf viewer could show me any pdf at all.

Even if I take a publicly accessible pdf on an https link such as this one for example it states 'can't open the pdf file - try opening it in your browser instead'  (rougly translated because of language settings)  opening in my browser naturally works but obviously I don't want to be using a pdf viewer to forward me to the browser.

 

so to sum it up; does this thing work at all or am I doing something wrong.

 

PDFviewerDoesntWorkAtAll.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User III
Dual Super User III

The problem is that the PDF viewer will only work with http:// (not https://) and only for non-authenticated addresses.  So SharePoint docs are out on both counts.  There is a workaround possible using Power Automate to generate the PDFs on the fly.  You can see a full demonstration here by Paul Culmsee, a fellow MVP.

https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Real-World-PowerApps-How-to-view-Shar...



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

6 REPLIES 6
Super User III
Super User III

kindly watch this video from Paul
https://youtu.be/NTp77benqfQ
Dual Super User III
Dual Super User III

The problem is that the PDF viewer will only work with http:// (not https://) and only for non-authenticated addresses.  So SharePoint docs are out on both counts.  There is a workaround possible using Power Automate to generate the PDFs on the fly.  You can see a full demonstration here by Paul Culmsee, a fellow MVP.

https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Real-World-PowerApps-How-to-view-Shar...



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

@Pstork1  and @eka24   thanks for taking the time to reply to my question. but have you experienced at your own hand recently that this worked? because i had already found these resources and tested them. but did not succeed which could very well mean that I did something wrong.

 

besides i'd like to point out that you are mistaken; it DOES require HTTPS not HTTP as you said (source )

https.PNG(rough translation:  PDF can't be opened - for security reasons files will only be opened through an HTTPS connection) this error shows when you attempt to open a pdf from an http link.

Dual Super User III
Dual Super User III

Its been a while since I used it, so I just looked at one of my old samples.  It still works for me.  But there are a number of limitations listed in the documentation.  All 4 of them can be an issue, particularly with SharePoint.  But Paul Culmsee's Flow solution should still work.

 

Limitations:

  1. The security architecture of Power Apps requires the PDF Viewer to support only HTTPS links, not HTTP.

  2. The Document property must link directly to the PDF file. Server redirects or HTML views of the document aren't supported.

  3. The server that hosts the document must not require authentication.

  4. You may not be able to view a PDF document in your app if the document resides on a server that has restrictive cross-origin resource sharing (CORS) settings. To resolve this issue, the server that hosts PDF documents must permit cross-origin requests from powerapps.com.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Pstork1  thanks for taking the time to try to help.

I guess i'll just have to give Paul's solution another try.

Dual Super User III
Dual Super User III

This walkthrough by Laura Rogers, another MVP, might also help.

https://wonderlaura.com/2018/08/30/powerapps-pdf-viewer/



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (76,625)