Hi Everyone,
My project is about display PDF from SharePoint Document Library. Created a Gallery by listing the Files from selected Folder.

Used PDF viewer to display the selected PDF.
OnSelect from Gallery Control:
UpdateContext({viewPDF:true});
Set(selectedPDF,Substitute(Gallery.Selected.Thumbnail.Large,"transform/thumbnail", "transform/pdf" ));
Document from PdfViewer:
selectedPDF
and tried
Substitute(Gallery.Selected.Thumbnail.Large,"transform/thumbnail", "transform/pdf" ))
Getting error.

Clicking 'Open in my browser instead', getting this json.
{"error":{
"code": "notSupported",
"message": "csv",
"innererror": {
"code": "InputFormatNotSupported"
}
}}
Where if I used Link to Item.
I can't view from PdfViewer. But when I click on 'Open in my browser instead' It opens the pdf.
I followed @Reza Doraini guide from https://www.youtube.com/watch?v=vqK29FWbLxU&t=813s
I am stuck in with this issue now. Anyone have any idea what I missing please help me out.
Thanks.