Requirement: Power apps PDF Viewer SharePoint Document library without Flow
Take SharePoint Document library which contains Templated like Word document , Excel sheet, Power point presentation, etc.., . Create a Blank canvas app add Data Source to the screen and add vertical gallery add data to it.
![](http://rishandigital.com/wp-content/uploads/2023/05/image-63-1024x637.png)
Now add Image to the screen on Image write the below code
Image Property: Gallery8.Selected.Thumbnail.Large
![](http://rishandigital.com/wp-content/uploads/2023/05/image-29-1024x462.png)
![](http://rishandigital.com/wp-content/uploads/2023/05/image-30-1024x460.png)
Now Add PDF View(Experimental) control to the screen place it on Image and write the code below
On Document Property:
If(
Last(
Split(
Gallery8.Selected.'File name with extension',
"."
)
).Value = "pdf",
"/:i:/s/ApprovalProcessPK/EZm9pd0AkchLognpsyWCtf0BzRMW9xWUKhTDRHaC6j9Dcg?e=pdf" & EncodeUrl(Gallery8.Selected.'Folder path' & Gallery8.Selected.'File name with extension'),
Substitute(
Gallery8.Selected.Thumbnail.Large,
"/thumbnail",
"/pdf"
)
)
Visible Property:
With(
{
fileextention: Last(
Split(Gallery8.Selected.'File name with extension',".")
).Value
},
If(fileextention="xlsx"||fileextention="docx"||fileextention= "ppt"||fileextention="pdf",true,false))
![](http://rishandigital.com/wp-content/uploads/2023/05/image-60-1024x377.png)
![](http://rishandigital.com/wp-content/uploads/2023/05/image-61-1024x389.png)
When user select an item in gallery it display on PDF Viewer. If the selected item is in PDF file then the PDF viewer doesn’t display any item present in the file.
![](http://rishandigital.com/wp-content/uploads/2023/05/image-62-1024x580.png)