cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WackdeMack
Resolver I
Resolver I

Showing pdf from a list

Hi all,

 

This morning i made a pdf viewer in a PowerApp from a library. I see there looks no workaround if you have stored the pdf's in a list. Is that correct? Here is het very simple flow for pdf viewer for a library.

 

Very curieus if anybody has this found out. 

 

PDF viewer library.png

1 ACCEPTED SOLUTION

Accepted Solutions

@EricLott,

 

Add a Pdf Viewer control to view PDF files,

1. add a gallery, bind to your share point list

2. set the Document property: First(Gallery1.Selected.Attachments).Value 

Snipaste_2020-01-09_15-53-59.png

Please note: PDF viewer is still in the experimental period with lots of limiations, please check the article: PDF viewer control (experimental) in Power Apps 

Sik

View solution in original post

7 REPLIES 7
EricLott
Resident Rockstar
Resident Rockstar

So you have a PDF and you want to display it in PowerApps?

Correct, every item had an attachment en i want to show the pdf inside the PowerApp. Now you have to download the attachment but i prefer a PDF viewer inside te PowerApp.

You can use a formula such as this in the PowerApps PDF Viewer control:

 

First(Gallery2.Selected.Attachments).Value

 

Where Gallery2 is the gallery your items are displayed in, or replace that with however your items are being selected.

 

2020-01-08 08_51_56-SQLQuery54.sql - ubpos02_liberty.INVENTORYSCAN (OWENSGROUP_elott (146))_ - Micro.png

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

@EricLott,

 

Add a Pdf Viewer control to view PDF files,

1. add a gallery, bind to your share point list

2. set the Document property: First(Gallery1.Selected.Attachments).Value 

Snipaste_2020-01-09_15-53-59.png

Please note: PDF viewer is still in the experimental period with lots of limiations, please check the article: PDF viewer control (experimental) in Power Apps 

Sik

View solution in original post

@EricLott @v-siky-msft  Thank you for your time, it works! Very happy about it but i see now. From the 10 orders,  orders have a pdf inside an 6 orders have a jpb/jpeg/png inside so there orders give an error, what makes sense.

 

Any tips for this solution? I guess, they can view the pdf inside the app but need to download the pictures on the phone?

@WackdeMack 

You could have an image viewer control as well as a PDF control and use something like this as their Visibly property:

PDF Viewer 'Visible' Property:
Not(IsBlank(Match(First(Gallery1.Selected.Attachments).DisplayName,".pdf",MatchOptions.Contains).FullMatch))

Image Viewer 'Visible' Property:
IsBlank(Match(First(Gallery1.Selected.Attachments).DisplayName,".pdf",MatchOptions.Contains).FullMatch)

Basically, if the name of the file contains .pdf, the PDF viewer is visible, if not, the image viewer is visible. You can then stack those viewers on top of each other and it will show the image/pdf.

The Image property will be the same as the PDF Document property.

First(Gallery1.Selected.Attachments).Value 

 ---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Wow! Really really awesome! Works fine. I only change the code for the image controller because i got an error.

IsBlank(Match(First(BrowseGallery1.Selected.Bijlagen).DisplayName,".pdf",MatchOptions.Contains).FullMatch)

 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,139)