cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
v-yamao-msft
Community Support
Community Support

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.
Anonymous
Not applicable

thanks for the reply Mabel,

 

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

 

Karl

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.
Anonymous
Not applicable

hi,

 

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

 

Karl

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.
Anonymous
Not applicable

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

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

Anonymous
Not applicable

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

Anonymous
Not applicable

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (18,552)