In this Power Apps tutorial video, we will explore how to use the PDF Viewer control in Power Apps to show PDF files & Office documents (Word, PowerPoint, Excel) from SharePoint Document Library without using Power Automate flows. PowerApps PDF Viewer control is using the API to transform Office documents into a PDF file. We can also use the Thumbnail property to show document previews. This entire concept showcases using the PowerApps PDF viewer control without flow.
#PowerApps #PDF #SharePoint
Reference Blogs:
Table of Contents:
00:00 – Introduction to Power Apps PDF Document Viewer
00:50 – SharePoint Document Library Setup
02:15 – Show Thumbnail of Documents in Power Apps
08:12 – Power Apps PDF Viewer show Word, PowerPoint & Excel documents without flow
15:56 – Show PDF files from SharePoint in PDF Viewer control without flow
24:45 – Subscribe to Reza Dorrani channel…(read more)
Convert Word 2 PDF: Word to PDF Converter
Convert PowerPoint 2 PDF: PPT to PDF Converter
Convert Excel 2 PDF: Excel to PDF Converter
Convert an Image 2 PDF: Image to PDF Converter
Convert HTML 2 PDF: HTML to PDF Converter
More Tools: PDF Converter
Hi Reza, I a beginner in power apps, and I am working my first project making progress dashboard and show monthly report through pdfviewer. Your tutorial is helping me a lot. But since I am showing pdf only, other users can not see the pdf, even though I already upgrade the permission to full control. Then I read your reply regarding dummy image file, it works now for other users. But I make some modification, instead of concatenating the ID, i remove the folder path and file name and copy and change image ID to "0". So here is the command, hope can help other on solving this pdf access issue.
1. copy small image file , save url in Pic column –. get the file ID (mine is 473)
2. Create new label, (label6) with text = Substitute(Substitute(LookUp(Documents,ID="473",Pic),"Shared%252520Documents%252fHCML.png", ""),"/473/","/0/")
3. Used the Label.text in Pdfviewer document input and add thee selected file folder path and filename = Label6.Text & EncodeUrl(Gallery4.Selected.'Folder path'& Gallery4.Selected.'File name with extension')
4. Keep the image file in the sharepoint, and make label6 invisible (visible=false)
it works ! Thanks
Show!!!
Reza Thanks for your video i was stuck on that part on my work it was very useful, it's a relief to get this part done
Hi @Reza, would like to ask if you have video for Searching Document Library files content based on inputted text in PowerApps for example.
Reza – your work here, and on other solutions, is critical to noob, "citizen developers" like myself. Thank you!
Question: does this PDF Viewer workaround not function in SharePoint Custom Forms designed in PowerApps? In trying to apply this, the Viewer works for .doc or .xls files, but I cannot get either pdfs or image files (jpeg) to display the image. Additionally, when clicking the link in the viewer to display in browser I get the following error:
{"error":{
"code": "notSupported",
"message": "pdf",
"innererror": {
"code": "InputFormatNotSupported"
}
}}
I am praying I've overlooked something simple. I am worried this simply does not work with the SharePointIntegration data connector.
Hi reza, its working using may editor account, but when i use other accounts It shoes Couldn't open Pdf File….
My problem is only on pdf files, other are ok.
Pdfviewer is not working for http link..error msg.. Couldn't open in pdf viewer..
This works great for the owner of the app but fails to load PDF for other users. Any solutions to this?
not works
Great Work Raza. I implemented your solution and it works great…but… only for me. The "appres://datasources…..) statetment, does not work for other users! Have you ever heard that happenning, and if so, is there a solution? Thank you once again for the great help you provide to all of us.
Best teacher
Best programmer
Best apps creator
Best applicator
Best of the best
Salute to you
Hi thanks a lot! I would like to confirm if it’s working for attachments of share point list as well.
Hi Reza,thanks for your teaching video. I am following the exactly same steps in the video to Substitute( Gallery1.Selected.Thumbnail.Large,"/thumbnail","/pdf"), but the PDF viewer control still display "Couldn't open PDF file". I check the output of this formula, it is like below:
=============
https://southeastasia1-mediap.svc.ms/transform/pdf?provider=spo&inputFormat=pdf&cs=fFNQTw&docid=https%3a%2f%2fwicren.sharepoint.com%3a443%2f_api%2fv2.0%2fdrives%2fb!p_hIrOzVREuGPUPfInFJh_my959veJBDuGN4sEbwsPrFzB9H93x0TZ0WDNu4xGRA%2fitems%2f01NF5FRPQMYIR53KLQQRCLTLNVLY4UKJ4T%3fversion%3dPublished&access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvd2ljcmVuLnNoYXJlcG9pbnQuY29tQDllNTEwNjRmLWY2YTUtNDFhMi04OWE5LTk3ODVhOWQ2YzcwNiIsImlzcyI6IjAwMDAwMDAzLTAwMDAtMGZmMS1jZTAwLTAwMDAwMDAwMDAwMCIsIm5iZiI6IjE2NzM5NDYwMDAiLCJleHAiOiIxNjczOTY3NjAwIiwiZW5kcG9pbnR1cmwiOiJQZmkxWS9KcnZJTkc2Zy9IamNac1hFSlNIMFFaTkNLRVBTVVZKTHhwK0FFPSIsImVuZHBvaW50dXJsTGVuZ3RoIjoiMTEzIiwiaXNsb29wYmFjayI6IlRydWUiLCJ2ZXIiOiJoYXNoZWRwcm9vZnRva2VuIiwic2l0ZWlkIjoiWVdNME9HWTRZVGN0WkRWbFl5MDBZalEwTFRnMk0yUXRORE5rWmpJeU56RTBPVGczIiwiYXBwX2Rpc3BsYXluYW1lIjoiQXBwIFNlcnZpY2UiLCJnaXZlbl9uYW1lIjoiQ2FycmllIiwiZmFtaWx5X25hbWUiOiJZYW5nIiwibmFtZWlkIjoiMCMuZnxtZW1iZXJzaGlwfGNhcnJpZUB3aWNyZW4ub25taWNyb3NvZnQuY29tIiwibmlpIjoibWljcm9zb2Z0LnNoYXJlcG9pbnQiLCJpc3VzZXIiOiJ0cnVlIiwiY2FjaGVrZXkiOiIwaC5mfG1lbWJlcnNoaXB8MTAwMzIwMDE4MzMwNmMxYkBsaXZlLmNvbSIsInNoYXJpbmdpZCI6Ijk0ZDJkOTNiLTI2OTItNDNlMC1hYjk2LTczNjcyMzY0MzFiMCIsInV0aSI6InZqVVVpU0hXNTAtaGNNUWRLZVliQUEiLCJ0dCI6IjAiLCJ1c2VQZXJzaXN0ZW50Q29va2llIjpudWxsLCJpcGFkZHIiOiIyMC4xOTUuODMuMSJ9.UjE2a2hqVnJHbHk4MHhkQjhqbEpweHBQTlJqK00rTVR2TWtZOGZJcGNLUT0&width=800&height=800
========
I copy above link to browser, it greeted me with below error, no pdf showcase:
=======
{"error":{
"code": "notSupported",
"message": "pdf",
"innererror": {
"code": "InputFormatNotSupported"
}
}}
=========
I am confused what's wrong. Could please educate me how to fix this error? Appreciate. I am just using SPO library to store the pdf files. My Teams account is v-yangyang1@microsoft.com or carrie@wicren.onmicrosoft.com. Look forward!!
Hello Sir, Thanks a lot for this video. This is really helpful. I have a slightly complicated issue with my reports. I have .ppt report presentation with embedded videos for simulations and animations. Is there a way to use this document viewer for such reports? In other words what I am looking for is to be able to use the pdf viewer with embedded videos or any other format which lets the user view the documents which include embedded animations or mp4 video clips. Kindly provide your guidance on this. Appreciate it. Thanks again!
Great work Reza. Works really well but ONLY for me. For all other users, they cane view images and word documents, but when it comes to PDF they cannot view. Why would that be?
do you know how to export pdf attachments/viewer to excel?
Hi Reza,
How can i get Open File option in PDF viewer?
Hi Rezza, WIll this do a lazy loading of the large PDF files?
Hi Reja,
Great video. We have implemented this feature. But, we do have an edit option in the gallery. User can click on edit and open the document in browser and make the changes in the document and it is automatically saved since it is cloud. However those changes are not reflected in the pdf viewer. tried refresh the document library, and tried refresh using timer but there is no use. We can't refresh and see the updated changes.
Could you please let me know if there is any workaround for this
Thanks a lot for your great video and looking forward for your reply
Hi Reza – great video. Is there a way to use this technique to show office documents, that are linked to a SharePoint list, as pdf's? I.e. without having the gallery to get the link from.
Amazing Work Reza. However, PDF viewer shows it for myself but not for others? do we need to perform additional steps for other users?
Hi Reza,
you are the Best! I am much into your Videos an learned a bunch of tricks to handle power apps. Please go on creating! They are all excellent. Greetings
Ralf
Hallo, first of all thank you very much for your amazing content. I love your vids and its by far the best content for the Power Platform. I have found a problem with this solution. It works perfect for myself but other users cant see the pdf in the viewer. I adapted permissions but it doesnt help. The users tried different browsers but it didnt help. Any ideas?
Hi Reza. Amazing work. I am encountering a problem. 19:30 mark — When I attempt to render the new hyperlink from the Pic column, the label shows the same clean hyperlink from the SharePoint Library, and not the long string beginning with “appres” (in-built memory link). Any idea why this is?
THANK YOU Reza. What an awesome video instruction. I have built the entire SharePoint document viewer using your instructions. I have one question. I wish to add a Search functionality to the Gallery. Not sure how to do it since there is already the following string in “Items”. Filter(‘FTM Portal’,’Folder Path’ = varCurrentPath). Thanks for any help you can provide
Awesome video tutorial, thanks for shared!
Hi Reza, this no longer works
Hi Reza,
Thanks for this. Wanted to know if the appres url that you mentioned in 15:56 and user needs access to the actual record in Sharepoint. What we are trying to achieve is the following – we want to remove end user access to the document library and use a service account in power automate to return a url that is accessible to end-user. We noticed that the thumbnail urls returned by the Get File Properties action has the access token of the service account attached to and if we pass this back to powerapps, any other user then gets to see the thumbnail or for that matter a pdf generated for excel/ppt/word. We actually wanted to use some similar concept and return a url from power automate that will allow the end user to download the document – pdf/image/visio/word/excel/ppt etc to their desktop without actually having any direct access given to the document library. Hope you have an answer
Regards