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

@Anonymous,

 

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

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.

Anonymous
Not applicable

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.

@Anonymous,

 

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

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

Anonymous
Not applicable

@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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,377)