cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
UB400
Level 10

PDF Control error with Sharepoint Document Library

I have some Documents in a Sharepoint Online Doc library that I wanted to view in the PDF Control, but I keep getting the "PDF.js v1.4.139 (build: 56f5c3a)
Message: Invalid PDF structure"

 

error message, regardless if I try using the Sharepoint generated link or I type in a direct link to the PDF document.

 

Any ideas if connections to PDFs in SharepointOnline Document libraries are supported?

6 REPLIES 6
Community Support Team
Community Support Team

Re: PDF Control error with Sharepoint Document Library

Hi @UB400,

 

Using the PDF viewer in PowerApps would require the PDF URL generated from the "Get a link", and this works from my side.

If this don't work from your side, please first check your PowerApps studio, make sure update to version 2.0.570.

62.PNG63.PNG

the URL for opening the PDF directly won't work here, which would result in the error you mentioned:

64.PNG

For more information regarding the PDF Viewer control, please see:

PDF viewer control in PowerApps

If you have any further questions, please post back.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
UB400
Level 10

Re: PDF Control error with Sharepoint Document Library

Hi @v-micsh-msft

 

Thank you for your response. i've checked the version of PowerApps Studio, it is 2.0.570

 

Looking at your screenshots, I noticed you used the "anonymous link" option, I tried that and it works, however the Docs I want to connect to are in a library where authentication is required.

 

I'm guessing that the PDF viewer does not open the document as it's unable to pass the User's credentials, is there a way of doing this?

Community Support Team
Community Support Team

Re: PDF Control error with Sharepoint Document Library

Hi @UB400,

 

Could you please explain a little about passing the User's credentials?

 

Based on what I know, if the URL could be accessed when building the app, then it should be no problem sharing the connection usage within PowerApps. See: Share App resources.

For the users would need access to the specific SharePoint Library, please make sure the permission is configured properly at the data source side.

If you have any further questions, please feel free to post back.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
UB400
Level 10

Re: PDF Control error with Sharepoint Document Library

@v-micsh-msft thanks for responding.

 

I don't know if it's a bug or not, but the PDF viewer control does not open a PDF in a library where permissions are required. In my case it can't be the lack of permissions that's causing the problem as I have full admin access to the library in question. I can open the library in a browser access any document and it's the same account I've used to create the App as well as while testing the App.

 

If possible could you kindly test the same i.e. instead of trying to access a document that allows anonymous access, could you try accessing a document in a library where permissions are required?

 

I'm using SharepointOnline by the way.

Community Support Team
Community Support Team

Re: PDF Control error with Sharepoint Document Library

Hi @UB400,

 

Apologize for the late response.

PDF Viewer control currently don't support the Link which requires authentication.

Please see this thread for reference, 

https://powerusers.microsoft.com/t5/PowerApps-Forum/PDF-Viewer-invalid-pdf-structure/td-p/16485

Reply from PA Staff irinak:

"

DF Viewer supports files that are accessible anonymously. It looks like in your case the link requires the user to be authenticated. A good way to test it is to open your IE in private mode and try open the PDF file through that link. If the browser prompts you to sign in to O365 then that link won't work in the PDF Viewer. Here is an article that talks about how to create anonymous guest links:
https://support.office.com/en-us/article/Share-sites-or-documents-with-people-outside-your-organizat...

 

If you do require users to be authenticated to access the document, please add this feature request at https://aka.ms/powerapps-ideas

 

Thank you,
Irina

"

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
UB400
Level 10

Re: PDF Control error with Sharepoint Document Library

Thanks @v-micsh-msft

 

I've added it to the Ideas section, In my view this feature is quite useless if you cannot access documents in a library that requires authentication, most of the documents in a workplace are going to reside in Document Libraries that require authentication.

 

Here's the link to the post in the ideas sectio, if any one wants to up-vote it.

 

https://powerusers.microsoft.com/t5/PowerApps-Ideas/PDF-Viewer-support-for-PDF-documents-in-Sharepoi...

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 186 members 5,719 guests
Please welcome our newest community members: