web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / PDF not loading in pdf...
Power Apps
Suggested Answer

PDF not loading in pdfviewer

(0) ShareShare
ReportReport
Posted on by
I am creating an app in Power apps and I am using a vertical gallery that gets its information from the sharepoint. I use a pdf viewer with a fx 
If(
    Last(
        Split(
            Gallery3.Selected.bestaandnamextensie;
            "."
        )
    ).Value = "pdf";
    "appres://datasources/Documenten/table/************" & EncodeUrl(Gallery3.Selected.'Volledig pad' & Gallery3.Selected.Bestandsnaamextensie);
    Substitute(
        Gallery3.Selected.Thumbnail.Large;
        "/thumbnail";
        "/pdf"
    )
)

I can see docx and excel files in the pdf viewer but not pdf. I'd be happy to receive some advice. Thank you.
Schermafbeelding 2026-02-27 094953.png
Categories:
I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     
    In your formula, the PDF branch builds an appres://… URI:
         "appres://datasources/Documenten/table/************" & EncodeUrl(...)
    appres:// is an internal app resource scheme, not HTTPS. The PDF Viewer only accepts HTTPS URLs or binary PDF content. Hence it refuses to load it.
     
    Your non‑PDF branch uses:
         Substitute( Gallery3.Selected.Thumbnail.Large, "/thumbnail", "/pdf" )
    That returns a proper HTTPS preview endpoint (via Microsoft’s viewer), so it works.
     
    Fix: give the PDF Viewer a real HTTPS URL (or binary content)
    Your formula rewritten (simple version)
    If(
        Lower(Last(Split(Gallery3.Selected.Bestandsnaamextensie, ".")).Value) = "pdf",
        // Build a real https link to the pdf file:
        "https://contoso.sharepoint.com" & Gallery3.Selected.'ServerRelativeUrl' & "?download=1",
        // For Office docs, use the pdf rendition endpoint:
        Substitute(Gallery3.Selected.Thumbnail.Large, "/thumbnail", "/pdf")
    )
    Replace https://contoso.sharepoint.com with your tenant/site origin.
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard