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 / Creating and Downloadi...
Power Apps
Answered

Creating and Downloading PDF of Container

(3) ShareShare
ReportReport
Posted on by 364
Hi there,
 
I'm trying to create a set up where you can press a button and it will take a screenshot of the page and then download it. I've followed a number of tutorials, and hit a bit of a dead end. I have followed the path of a button to save the content to a variable, then an attachment form element to allow users to click and download the generate content.
 
This is what the button code is:
 
Set(
    pdfContent, 
    JSON(
    PDF(
        Container5_1,
        {
            ExpandContainers: true,
            Orientation: PaperOrientation.Landscape,
            Size: PaperSize.A4,
            DPI: 150
        }
    ), JSONFormat.IncludeBinaryData)
);
In the items paramater of the attachment control I have this code:
 
{Name:"Marking Matrix" & ".pdf", Value: pdfContent}
 
The download prompt appears, but when it goes to download, i get nothing but my browser saying: "File wasn't available on site". This is the bit that stumps me completely. What's more, is I can do the version of this where it emails the PDF, and that works great, but email is sadly not an option here.
 
Any help??
Categories:
I have the same question (0)
  • Suggested answer
    stampcoin Profile Picture
    5,153 Super User 2026 Season 1 on at
    I think download function only support a web resource. Not a dummy address.
    You can add outlook connector to send the attachment.
    Or you manipulate a table in dataverse, just use one column , define it as file type, then you will make it. 
    you can delete it after a while.
     

    Enjoy Power Platform and have a great day 🚀 |  My LinkedIn

    If the answer helps, please consider 👍, Thanks.

  • Suggested answer
    w.p Profile Picture
    8,345 Super User 2026 Season 1 on at
    { Name: "Marking Matrix.pdf", Value: Mid(pdfContent, 2, Len(pdfContent)-2) }
     
  • EpicTriffid Profile Picture
    364 on at
    Hi @w.p
     
    That doesn't seem to make a difference I'm afraid!
     
     
    I'm not directly using the download function, but rather downloading via the attachments control?
  • w.p Profile Picture
    8,345 Super User 2026 Season 1 on at
    Mid(pdfContent, 2, Len(pdfContent)-2)
    What does your output look like?
  • stampcoin Profile Picture
    5,153 Super User 2026 Season 1 on at
    If you utilize the file type in dataverse table , yes, you can download it from attachment ( there are kind of the same control).
    unless you want to avoid using dataverse.
  • EpicTriffid Profile Picture
    364 on at
     
    Is it possible to use dataverse tables without actually storing anything on them? Never actually used dataverse!
  • EpicTriffid Profile Picture
    364 on at
     
    No output at all! It just says File not found again when i try to download it!
  • w.p Profile Picture
    8,345 Super User 2026 Season 1 on at

    Can you share some screenshots?
    Have you enabled the PDF function?

  • EpicTriffid Profile Picture
    364 on at
    Hi @w.p
     
    Of course!
     
    Yup, PDF has been enabled in the settings.
     
    This is the code to generate the PDF of the container:
     
     
    That then makes the Attachments control populate:
     
     
    That has this code:
     
     
    Clicking on it loads up the downloads prompt:
     
     
    Pressing Save then causes this to appear in the Download queue (I've tried it a few times):
     
  • stampcoin Profile Picture
    5,153 Super User 2026 Season 1 on at
    I think if you use dataverse table or sharepoint, you generate the file, save there, delete it.
    it's like cache, you cannot avoid it.
    otherwise it may take time .

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard