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

Notifications

Announcements

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,058 Super User 2025 Season 2 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,339 Super User 2025 Season 2 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,339 Super User 2025 Season 2 on at
    Mid(pdfContent, 2, Len(pdfContent)-2)
    What does your output look like?
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 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,339 Super User 2025 Season 2 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,058 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard