cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gjeh
Responsive Resident
Responsive Resident

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
Pstork1
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
eka24
Super User III
Super User III

kindly watch this video from Paul
https://youtu.be/NTp77benqfQ
Pstork1
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

gjeh
Responsive Resident
Responsive Resident

@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.

Pstork1
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.
gjeh
Responsive Resident
Responsive Resident

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

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

Pstork1
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,194)