Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Q4h7NyoZnVbmSLDkQdnZvY
Power Apps - Building Power Apps
Answered

Getting PDF viewer to display PDF's stored in SharePoint

Like (1) ShareShare
ReportReport
Posted on 5 Nov 2020 18:23:31 by

I have a PowerApp and I am simply trying to display a PDF across from a form containing the data parsed from that PDF using a custom AI model which I have built. I have the PDF name and everything.

 

In the "Document" property, I tried this: 

"https://xxxxxx.sharepoint.com/sites/POCApprovalWorkflow/StoredInvoices/" & InvoiceNameValue

I get the common "Couldnt open PDF file"

 

To debug further, I hard coded in the URL to one specific PDF and still get the same issue:

"https://xxxxxx.sharepoint.com/sites/POCApprovalWorkflow/StoredInvoices/img-608115638-0001.pdf"

 

I am using https which I have seen is required but I did see somewhere there is an extra step is they are stored in SharePoint, can someone help explain this?

 

-Greg

  • Community Power Platform Member Profile Picture
    on 08 Nov 2020 at 01:42:00
    Re: Getting PDF viewer to display PDF's stored in SharePoint

    This is beautiful and works like a charm without premium connectors.

  • Verified answer
    KrishnaV Profile Picture
    5,023 on 08 Nov 2020 at 01:40:09
    Re: Getting PDF viewer to display PDF's stored in SharePoint

    Hi @Anonymous ,

     

    Please create a Flow to render the selected file and then show the file content as part of your PDF viewer:

    KrishnaV_0-1604799530262.png

    on the App call the Flow it as like this:

    Set(
     ViewPDF,
     RenderPDF.Run(
     stSite,
     Concatenate(
     "/",
     stFolder,
     ThisItem.'{FilenameWithExtension}'
     )
     )
    );
  • Community Power Platform Member Profile Picture
    on 06 Nov 2020 at 16:39:54
    Re: Getting PDF viewer to display PDF's stored in SharePoint

    My PDF documents are stored in SharePoint but I can save them anywhere. Where should I save them to get the PDF viewer to work? If you could explain the recommended use for the viewer it would help many people!

  • v-jefferni Profile Picture
    on 06 Nov 2020 at 13:13:09
    Re: Getting PDF viewer to display PDF's stored in SharePoint

    Hi @Anonymous ,

     

    Could you please share more details about your scenario? Did you store PDF files in SharePoint library? 

     

    If you do store PDF files in library, you may not be able to retrieve the file through a URL, please refer to below doc:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-pdf-viewer#limitations 

     

    Note: 

    You may not be able to view a PDF document in your app if the document resides on a server that has restrictive cross-origin resource sharing (CORS) settings. To resolve this issue, the server that hosts PDF documents must permit cross-origin requests from powerapps.com.

     

    Please refer to the thread below to know how to create a flow to get the PDF from library:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Getting-PDF-Viewer-to-work-on-SharePoint-Document-Library/td-p/651547

     

    Please try the solution and if you have any question please feel free to let us know.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Community Power Platform Member Profile Picture
    on 06 Nov 2020 at 02:25:20
    Re: Getting PDF viewer to display PDF's stored in SharePoint

    Additional note: under the bold "Couldn't open PDF file" there is a link "Open in my browser instead" and when I click on that link, the PDF comes right up, so I know the dynamic link I am passing is good.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 14

#2
LC-26081402-0 Profile Picture

LC-26081402-0 10

#3
stampcoin Profile Picture

stampcoin 6

Overall leaderboard