Introduction
This article provides a comprehensive, step-by-step process to display a PDF file stored in a SharePoint Document Library within a Power Apps canvas app using the PDF Viewer (experimental) control. The instructions are tailored to ensure clarity, accuracy, and a seamless experience, addressing common issues such as the PDF not displaying in preview mode. Follow these steps to set up your Power Apps project, connect to SharePoint, and configure the PDF Viewer control correctly.
Below is a detailed, step-by-step article to help you display a PDF stored in SharePoint within your Power Apps application using the experimental PDF Viewer control.
![Sharepoint]()
Step-by-Step Instructions
Step 1. Open or Create a Power Apps Project.
- Navigate to https://make.powerapps.com.
- Either:
- Create a new Canvas app (start from blank), or
- Open an existing app where you want to display the PDF.
Step 2. Connect to the SharePoint Document Library.
- From the left panel, click on Data.
- Click on + Add data.
- Search for SharePoint and select it.
![Add Data]()
- Choose your account, paste or search for your SharePoint Site URL, and then click Connect.
- Select your Document Library where your PDFs are stored, then click Connect.
- (Optional) Open your SharePoint Document Library in a new tab and upload your PDF if it's not already available. This ensures the document can be linked and previewed in Power Apps.
Step 3. Insert the Experimental PDF Viewer.
- In Power Apps, click on the Insert or + icon on the left toolbar.
- Use the search bar to search for PDF Viewer (experimental).
![PDF]()
- Click to insert it into your screen.
Step 4. Set Up PDF Viewer to Display a File.
Start by using this formula in the Document property of the PDF Viewer.
LookUp(
Documents,
Name = "Sample PDF.pdf"
).'Link to item'
Note. This may not always work as expected in Power Apps. If the PDF doesn't load, try the workaround method below to generate a direct file link.
Workaround: Generate a Direct PDF URL Manually
Sometimes, Power Apps doesn't support rendering the default SharePoint link ('Link to item'). Instead, you can manually create a direct PDF link.
Steps to generate a working PDF link.
1. In SharePoint Document Library.
- Click on + Add Column > Select Hyperlink.
- Name it: Link.
2. Once the column is created, go to Library Settings, then click on the Link column.
Change the Format URL from Hyperlink to Picture.
![URL]()
3. Back in your Document Library.
- Click on the ellipsis (...) next to the PDF file.
- Click Open in browser. The PDF opens in a new tab.
- Copy the full URL. Remove everything after .pdf so that the link ends with .pdf.
4. Go back to your document library and,
- Click on Edit in grid view.
- Paste this cleaned-up PDF URL into the Link column for that file.
- Click Exit grid view to save changes.
![Grid]()
Step 5. Update Power Apps to Use the Cleaned URL.
Finally, update the Document property of the PDF Viewer to reference your new link column.
LookUp(
Documents,
Name = "Sample PDF.pdf"
).Link
Success! Your PDF should now render properly inside the Power Apps screen.
![Screen]()
Pro Tips
- Use Preview mode (F5) to test PDF rendering.
- Ensure your PDF link ends with .pdf - any additional query parameters or tokens may break it.
- This experimental control works best with direct-access or publicly accessible links.
Use Case Example
This method is ideal for onboarding portals, document approval systems, training guides, or resource libraries where documents need to be viewed quickly without downloading.
Conclusion
By following these steps, you can successfully display a PDF from a SharePoint Document Library in Power Apps using the PDF Viewer (experimental) control. The Hyperlink column workaround simplifies the process by bypassing authentication issues, while Power Automate offers a robust alternative for complex scenarios. Enhance your app with a gallery for dynamic file selection and ensure proper permissions to provide a seamless user experience.