cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

PDF Viewer: invalid pdf structure

evening,

 

I am trying to get the pdf viewer to work using a pdf that Excel 2016 has created. I just keep getting this message...

 

PDF.js v1.4.139 (build: 56f5c3a)
Message: Invalid PDF structure

 

can anyone help with this?

 

Karl

15 REPLIES 15
Highlighted
Community Support
Community Support

Re: PDF Viewer: invalid pdf structure

Hi Karl,

 

From this document we know that when we using PDF viewer control, an URL for the PDF file is needed.
https://powerapps.microsoft.com/en-us/tutorials/control-pdf-viewer/

 

What’s the URL being used?
I guess that your PDF file is saved in local. It seems that the PDF in local is not supported currently.

 

About this issue, may I suggest you submit an idea at PowerApps Ideas Fourm:
https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: PDF Viewer: invalid pdf structure

thanks for the reply Mabel,

 

The document is stored on Onedrive for business, and the link has been generated from there.

 

Karl

Highlighted
Community Support
Community Support

Re: PDF Viewer: invalid pdf structure

Hi Karl,

 

Thanks for your reply. If your PDF files are saved on OneDrive for Business, you could try this:
1. Open the PDF file in browser.
2. Click “Get link”

Get link1.PNG

3. Click “Create”
Get link2.PNG


4. Click “Copy”, click “Allow Access”.

get link3.PNG

5. In the app, add a PDF control, then set its Document property as “URL”.

 

Now, the PDF files are shown properly on my side. Please try my steps on your side to see if it works.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: PDF Viewer: invalid pdf structure

hi,

 

Thanks for that. Unfortunately, it didnt work.... still getting the same error message

 

Karl

Highlighted
Community Support
Community Support

Re: PDF Viewer: invalid pdf structure

Hi Karlkeegan,

 

Could you show me your URL? I test this again on my side, it works well.

 

I format an Excel file as a PDF file. Then upload it to OneDrive for Business. Below is how the PDF is shown on the app with different URL.

 

The first one with a wrong URL, so I get the same result with you:
PDF.js v1.4.139 (build: 56f5c3a)
Message: Invalid PDF structure

URL2.PNG

 

The second one with the right URL, so it can be shown on the app.

URL3.PNG


Please show me your URL, and if convenience, please show me your steps also to reproduce this issue.


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: PDF Viewer: invalid pdf structure

Hi there,

 

apologies for the late reply. I am clicking on the file in onedrive, and then clicking get link. from here it opens a box, and I am creating an edit link which is as follows...

 

https://royalmencapsociety-my.sharepoint.com/personal/karl_keegan_mencap_org_uk/_layouts/15/guestacc...

 

then opening PowerApps, adding a PDF Viewer control and putting this link (inside " ..")

 

still getting the same error message..

 

Karl

Highlighted
Power Apps
Power Apps

Re: PDF Viewer: invalid pdf structure

Hi Karl,

 

PDF 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

Highlighted
Anonymous
Not applicable

Re: PDF Viewer: invalid pdf structure

Thanks for that Irina,

 

That would explain why that's not working! can this be done from my personal onedrive? or Dropbox? I have tried both, and still getting the same result.

 

Karl

Highlighted
Anonymous
Not applicable

Re: PDF Viewer: invalid pdf structure

Update,

 

I have tried using googledrive public links, using link extender to extend the ondrive links from my personal onedive... not sure what to try next?

 

Karl

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,550)