cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
WackdeMack
Level: Powered On

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
Microsoft v-siky-msft
Microsoft

Re: Showing pdf from a list

@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
Level 10

Re: Showing pdf from a list

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

WackdeMack
Level: Powered On

Re: Showing pdf from a list

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.

EricLott
Level 10

Re: Showing pdf from a list

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.

Microsoft v-siky-msft
Microsoft

Re: Showing pdf from a list

@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

WackdeMack
Level: Powered On

Re: Showing pdf from a list

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

EricLott
Level 10

Re: Showing pdf from a list

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

WackdeMack
Level: Powered On

Re: Showing pdf from a list

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,616)