cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anon622
Helper I
Helper I

PDF Viewer not showing pdf file

Hello

 

I am working on a Powerapp where i use the PDF viewer to pull up PDF files from sharepoint. The Left column where you can select which PDF file to look at works fine. The problem arises when you click on the file and a blackish grey screen shows. So basically nothing shows up lol

 

Not sure what to do from here. I attached a snip of the small error that shows up but not sure if its connected. 

 

 

10 REPLIES 10
Pstork1
Dual Super User
Dual Super User

The PDF viewer only works with files served from an anonymous access location. So it normally won't work with files hosted in SharePoint.  The link below provides a workaround for how to use Power Automate to display PDF files from SharePoint in Power Apps.

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.
v-xida-msft
Community Support
Community Support

Hi @Anon622 ,

Do you want to preview the PDF file stored in your SP Library inside your canvas app?

Do you type the SP URL Link of your PDF file within the Document property of the PDF Viewer control directly?

 

If you want to preview the PDF file stored in your app SP Library inside your canvas app, I think the combination of Power Automate flow and PowerApps canvas app could achieve your needs. Please check and see if the following blog could help in your scenario:

https://masteroffice365.com/viewing-pdfs-from-sharepoint-within-powerapps/

 

Also please consider check the following video resource:

https://youtu.be/Clu45Rknpvk 

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Thats unfortunate. Would it be easier if perhaps we could convert the PDF file to an image like a JPG?

 

Seems crazy that we have to go through so many steps just to 'view' a PDF off sharepoint

Picture controls will show the JPG just fine coming from an authenticated SharePoint library.  But you will lose a lot of control for things like scaling, paging etc. that is built into the 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.

Hi @Anon622 ,

Do you want to convert the PDF file into a image?

 

I agree with @Pstork1 's thought almost. The Image control in canvas app could not display a PDF file with same functionality as the PDF Viewer control. e.g. The pagination functionality is not supported in Image control.

 

It is an known issue in canvas app -- when displaying image file/PDf file which needs authentication from SP Library in a canvas app, you may not display it correctly. As an fixed solution, you could consider retrieve the file content (binary data) of the PDf file, then you could display it in your canvas app.

 

As an possible solution, please try the solution I provided above to achieve your needs. The video resource I provided above may help in your scenario.

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Yes I want the pdf to show/display when i click on it within a PDF viewer. We are going to have biweekly reports. I am having a problem with the first steps in the video you referred me to.

 

I am unable to match/find the trigger that they mention in the video. Its called "Request - When a HTTP request is received". 

 

For now I am using one of the triggers that is specifically for Sharepoint. For the time being I elected "Sharepoint - When a file is created in the folder"

 

Which trigger is best?

The HTTP trigger is so you can invoke the flow from a Power Apps form.  The automated trigger you've selected will try to display the PDF when it is received.  But at that point there is no one to display it to.  Here's how to find the trigger you want.  Please Note: it does require a Premium license

image.png



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

Hi @Anon622 ,

Regarding the needs that you mentioned, I think it is not necessary to add a "Request - When a HTTP request is received" trigger in your flow.

 

As an easy solution, I think the "PowerApps" trigger button could achieve your needs. The "PowerApps" trigger button is designed specially for Power Apps and Power Automate, which is used to pass parameters from canvas app to your Power Automate flow.

 

More details about firing a flow from a canvas app, please check the following video resource:

https://www.youtube.com/watch?v=1wl9AtxWdkg

https://www.youtube.com/watch?v=HhMpAuVGfho

 

Please refer to the following blog (which has given a step by step solution) to achieve your needs:

https://masteroffice365.com/viewing-pdfs-from-sharepoint-within-powerapps/

 

If above solution is helpful, please consider go ahead to click "Accept as Solution" to identify my reply as helpful.

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello

 

Thanks for clarifying, Before I reach out to the employer for Premium licensing will this work for what I'm aiming to do?

 

Just need the PDF to show/display via the PDF viewer. The reports will come in bi-weekly. Someone will drop in a new report in the Sharepoint list every 2 weeks. I won't have to update the flow to accommodate that right?

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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