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
Community Champion
Community Champion

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.

EricLott
Community Champion
Community Champion

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

@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
Community Champion
Community Champion

@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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,240)