cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OpenMindt_abf
Frequent Visitor

PDF viewer doesn't work on certain smartphone

Hi, I've built multiple apps, and they all have the same problem. The PDF viewer work anytime when I open the app on desktop, but there are lots of problems on the smartphone app.

 

On some phones like my Pixel 6 (Android 13)

Sometimes it works

Android Work.png

Sometimes it only shows a small part of the PDF (It should be more like the first screenshot)

Android Don't Work.png

But on most other phones, IOS and Android, it just doesn't show it at all...

Android And IOS don't work.png

It shows an error message saying "Couldn't open PDF file, Make sure the PDF file is coming from an HTTPS link".

 

 

The field Document of the PDF Viewer contain the variable varPDFLink, set like this :

Set(varPDFLink,"appres://datasources/BonsDeLivraison%20-%20PDF/table/5900a294-11a9-45eb-8f23-85456359774d/rows/1/reference/https:%2F%2Fcanada-001.azure-apim.net%2Fapim%2Fsharepointonline%2F79baf01e9a834a52be74919205254840%2Fdatasets%2Fhttps%25253a%25252f%25252farmaturesboisfrancs.sharepoint.com%25252fsites%25252fARMATURESBOIS-FRANCS%2FGetFileContentByPath%3Fpath=%252fBonsDeLivraison%252520%252520PDF%252f" & EncodeUrl(varNumBon&".pdf"));

 I've printed the debug info to be sure that everything is fine

Screenshot_20220706-094705.pngScreenshot_20220706-094529.pngScreenshot_20220706-094452.png

 

As you can see, except the last part (equivalent to the varNumBon variable) of the appres://datasources link, they are all identical, but on some phone they work, and on some other they don't...

 

The PDF links are all using HTTPS as you can see from the debbug informations.

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

The pdf viewer in Power Apps only works with sources that don't require authentication.  The links you are posting suggest that the PDFs are coming from SharePoint, which does require authentication.  The following Blog post walks through how to retrieve the PDF using a flow and display it in Power Apps.  Power Apps View A PDF Stored In A SharePoint Document Library (matthewdevaney.com)



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

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User
Dual Super User

The pdf viewer in Power Apps only works with sources that don't require authentication.  The links you are posting suggest that the PDFs are coming from SharePoint, which does require authentication.  The following Blog post walks through how to retrieve the PDF using a flow and display it in Power Apps.  Power Apps View A PDF Stored In A SharePoint Document Library (matthewdevaney.com)



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

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

OpenMindt_abf
Frequent Visitor

Thanks for your response! That's a weird limitation, I'll implement this solution and see if it works.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

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