June 12, 2025

Embed PDFs in Power Apps Using the Experimental PDF Viewer

Introduction

Power Apps now offers an experimental PDF Viewer control that lets you display PDFs directly within your app interface. This is especially helpful in use cases like displaying reference documents, training guides, or reports stored in SharePoint Document Libraries - without requiring users to download them.

Below is a detailed, step-by-step guide to help you display a PDF stored in SharePoint within your Power Apps application using the experimental PDF Viewer control. 

Power Apps - PDF Viewer

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 SharePoint Document Library 

  1. From the left panel, click on Data.
  2. Click on + Add data.
  3. Search for SharePoint and select it.
    Add data source in Power apps

  4. Choose your account, paste or search for your SharePoint Site URL, and then click Connect.
  5. Select your Document Library where your PDFs are stored, then click Connect.
  6. (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 

  1. In Power Apps, click on the Insert or + icon on the left toolbar.
  2. Use the search bar to search for PDF Viewer (experimental).
    Insert PDF viewer (experimental)

  3. 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:

  1. Click on + Add Column > Select Hyperlink.
  2. Name it: Link

2. Once the column is created, go to Library Settings, then click on the Link column. 

  1. Change Format URL as: from Hyperlink to Picture.
    Library Setting - Hyperlink to Link

3. Back in your Document Library: 

  1. Click on the ellipsis (...) next to the PDF file.
  2. Click Open in browser. The PDF opens in a new tab.
  3. Copy the full URL. Remove everything after .pdf so that the link ends with .pdf.

4. Go back to your document library and:

  1. Click on Edit in grid view.
  2. Paste this cleaned-up PDF URL into the Link column for that file.
  3. Click Exit grid view to save changes. 

Edit in grid and update the url - remove extra from the link ends with .pdf
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. 

Show PDF in Power Apps using PDF viewer


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


Conclusion:

Embedding PDFs within Power Apps is now easier thanks to the experimental PDF Viewer control. With a direct SharePoint link configured properly, you can enable seamless in-app PDF viewing for onboarding guides, reference documents, and more - without needing third-party tools or downloads. 

If you have any questions you can reach out our SharePoint Consulting team here.

No comments:

Post a Comment