I linked the documents section of my SharePoint power apps to make a PDF viewer of the files in my documents. There are images, PDF, and docx files. I uploaded all the documents from my laptop. The docx files could be viewed, the problem is with the PDF files. I watched a YouTube tutorial and used this formula:
If(
Last(
Split(
Gallery2.Selected.'File name with extension',
"."
)
).Value = "pdf",
"appres://datasources/Documents/table/21eadea4-3ddb-4174-9c30-ae06d5d41a65/rows/8/reference/https:%2F%2Fasia-001.azure-apim.net%2Fapim%2Fsharepointonline%2F86230366289649d199b3a86ed63f39ee%2Fdatasets%2Fhttps%25253a%25252f%25252ftoyotaastra.sharepoint.com%25252fsites%25252fCobacoba%2FGetFileContentByPath%3Fpath=%252fShared%252520Documents%252f" &
EncodeUrl(Gallery2.Selected.'Folder path' & Gallery2.Selected.'File name with extension'),
Substitute(
Gallery2.Selected.Thumbnail.Large,
"/thumbnail",
"/pdf"
)
)
However, the result is as in the image below. Can anyone help me out?