Skip to main content

Notifications

Power Apps - Power Apps Experimental Features
Answered

PDF Function and Pagination

(0) ShareShare
ReportReport
Posted on by 4,547
I've been practicing with the Power Apps PDF function.

I've managed to create a multiple page PDF in Power Apps.

My issue, how do I control the pagination, or cut off for each page.

Currently I am getting individual pages, but the related data may run
over to the next page in a disjointed way.

Is there a way in Power Apps to control the data that appears on each
page of a PDF form created using the PDF function?

Page 1 -
 
 
Bottom of Page 1 carried over to top of Page 2 -

  • Verified answer
    Pstork1 Profile Picture
    Pstork1 64,909 on at
    PDF Function and Pagination
    The built-in PDF conversion capability doesn't have support for controlling Page Breaks.  The one way to do it is by creating a background image of a specific size to take up a page and using that to control the page breaks. Shane Young explains in this video how to do that. QTT - Power Automate PDF Page Breaks 
     
    To convert an HTML document with dynamic page breaks you need to use one of the third party PDF conversion connectors, like Encodian.  They have support built in for actual page breaks, which the internal function does not.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • BD-01080338-0 Profile Picture
    BD-01080338-0 22 on at
    PDF Function and Pagination
    There are six sections within the overall document.
     
    Your solution assumes each each section has a fixed height, yes?
     
    This is not the case.
     
    A section may have nothing but a header and one sentence  - "No issues reported "; whereas that same section, in another report, may have a page and a half of identified issues.
     
    This will change week to week, section to section - this is an inspection report.
     
    Is there a way to account for section / page height dynamically?
  • SwatiSTW Profile Picture
    SwatiSTW 316 on at
    PDF Function and Pagination
    You can try below steps to make it work
    1. Collect the data and split it into logical groups that fit within one page. Use collections to organize the data for each page.
    ClearCollect(
        Page1Data,
        FirstN(MyDataSource, 10)
    );
    ClearCollect(
        Page2Data,
        LastN(MyDataSource, CountRows(MyDataSource) - 10)
    );
    2. Create separate screens or containers for each page. Add labels, galleries, or other controls to display the data. Bind the first container to Page1Data and the second container to Page2Data.
    3. On the first container, set the Items property to Page1Data.
    Items = Page1Data
    4. On the second container, set the Items property to Page2Data.
    Items = Page2Data
    5. Design each container or screen to fit the required page layout, ensuring proper alignment and spacing.
    6. If using HTMLText for advanced formatting, include page-break CSS for controlling pagination.
     
    7. When generating the PDF, use the Export or Generate function based on the pages or HTMLText you’ve created.
    PDFControl.PDFExport()
    Test the layout by generating the PDF to ensure the data stays within its designated pages. Adjust item counts or container heights as needed.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard

Featured topics