web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Getting PDF viewer to ...
Power Apps
Unanswered

Getting PDF viewer to display PDF's stored in SharePoint

(1) ShareShare
ReportReport
Posted on 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

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    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.

  • v-jefferni Profile Picture
    on at

    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 at

    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!

  • Verified answer
    KrishnaV Profile Picture
    5,023 on at

    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 at

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard