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
This is beautiful and works like a charm without premium connectors.
Hi @Anonymous ,
Please create a Flow to render the selected file and then show the file content as part of your PDF viewer:
on the App call the Flow it as like this:
Set(
ViewPDF,
RenderPDF.Run(
stSite,
Concatenate(
"/",
stFolder,
ThisItem.'{FilenameWithExtension}'
)
)
);
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!
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:
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.
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.
MS.Ragavendar
14
LC-26081402-0
10
stampcoin
6