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 / Print two different sc...
Power Apps
Answered

Print two different screens in the same pdf file

(0) ShareShare
ReportReport
Posted on by 198

Hi guys, I'm having a problem. I need to generate a pdf of a certificate based on two screens. However, the print function only generates the separate file of both screens. I would like to know if it is possible to print both screens in the same pdf file.

 

I've attached screenshots of the two screens (Teste 1 and Teste 2 respectively) and an example of how it should look.

Categories:
I have the same question (0)
  • renatopc84_ch Profile Picture
    228 on at

    Hi @Pizzolati 

    I solved it following another post (I cannot find it now), using a container.

    Basically you create the container with the two pages, you save it in a variable and create the pdf with the variable as source. By me worked for many pages, but with more than 3-4 pages requires already 30-40 seconds

  • Pizzolati Profile Picture
    198 on at

    Hi renato, thanks for your reply. But I don't understand how I'm going to place the two screens inside the container.

  • renatopc84_ch Profile Picture
    228 on at

    Hi @Pizzolati 

    I can provide you more details tomorrow, but basically I followed this post https://powerusers.microsoft.com/t5/Building-Power-Apps/PowerApps-Print-Multiple-pdf-Pages/td-p/1551337

     

  • Pizzolati Profile Picture
    198 on at

    Hi
    @renatopc84_ch . I've already looked at this topic, but I don't understand how I'm going to get the pdf of the two different screens together to be like in the example. If not, I'll wait for your reply tomorrow.

  • renatopc84 Profile Picture
    44 on at

    Hi @Pizzolati 

    I noticed today that my answer has not been published.

     

    I will try again.

    renatopc84_0-1709234663476.png

     

  • renatopc84 Profile Picture
    44 on at

    Now the explaination

    A Container is like a page and can contain other Containers as well.

    So you create the first Container Vertical, and inside you create the Containers in the order that you need (from TOP to DOWN is the exact order).

     

    Now the tricky part is that if you want to print it you need to calculate the pixels and play a little bit with it.

    I created in my case also a preview with the PDF Viewer component.

     

    So first of all in the "On Visible" property of the page you have to create a variable for the PDF Content, in my case for an A3 format.

     

    Set(
    varPDFContent;
    PDF(
    S8_Container_PDF_Loading;
    {
    Orientation: PaperOrientation.Landscape;
    Size: PaperSize.A3;
    Margin: "20px";
    ExpandContainers:true
    }
    )
    )

     

    This variable will be used also in the PDF Preview (I created here an additional container that is out of the viewable screen with a sample text).

  • Verified answer
    renatopc84 Profile Picture
    44 on at

    On the PDF Viewer you have only to set the variable in the "Document" property.

     

    Then you create a Button for the PDF generation with the following code:

     

    Set(
    varPDFContent;
    PDF(
    S7_ContainerMultipage;
    {
    Orientation: PaperOrientation.Landscape;
    Size: PaperSize.A3;
    Margin: "20px";
    ExpandContainers:true
    }
    )
    );;

     

    Practically the same as in the "OnVisible" property only with another container.

     

    The calculation for the containers is the dimension in inches multiplied for the DPI.

    In my case an A3 is 11.69 x 16.54 inches and I used a 96 DPI (to let the screen fit in the preview).

    The calculation:

    11.69 x 96 = 1122.24

    16.54 x 96 = 1587.84

     

    Then you have to play a little bit to let it fit.

    So in my case all the containers are 1090 x 1556. 

    As you can see in my previous answer I used a container for the first page (fix) and a gallery for all the other pages with variable content. The gallery has the same dimensions and also the templateheight property of the gallery.

     

    To download the generated PDF you can take from a Form the Attachment field and use this code:

     

    {
    Name:(FilenameCalculated & ".pdf");
    Value:varPDFContent
    }

     

    I hope this can help

     

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard