Showing results for 
Search instead for 
Did you mean: 
Kudo Kingpin
Kudo Kingpin

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?

Community Support
Community Support

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.


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


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

PDF viewer control in PowerApps

If you have any further questions, please post back.


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.

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?

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.


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.

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

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,

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:


If you do require users to be authenticated to access the document, please add this feature request at


Thank you,



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.

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.


Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.


New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,469)