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 - Expand Container...
Power Apps
Unanswered

PDF - Expand Containers not working for Gallery and Container

(0) ShareShare
ReportReport
Posted on by 27
Dear All, 
 
It would be much appreciated if you would help me on this. 
I have screen consist of one main container (ResultMainContainer_Test), one left sub-container(LeftContainer_Test) and one right sub-container (RightContainer_Test), and a Gallery was included in the RightContainer.
The Gallery contains list of information which cannot show in one page. I want to export the main container to one pdf file, including all the information listed in the Gallery.
 
When the "Proceed Next" button was selected, it will generate a pdf file and send for approval by Power Automate (ApprovalEmail). Please find the code below:
Set(
    PDFContent,
    {
        ContentBytes: PDF(
            ResultMainContainer_Test,
            {
                Orientation: PaperOrientation.Portrait,
                Size: PaperSize.A4,
                DPI: 150,
                ExpandContainers: true
            }
        ),
        Name: "Executive Summary.pdf",
file: {
    contentBytes: PDF(ResultMainContainer_Test),ExpandContainers: true,Orientation: PaperOrientation.Portrait,
                Size: PaperSize.A4,
                DPI: 150,
    name: "Executive Summary.pdf" 
}
 
    }
);
 
ApprovalEmail.Run("Executive Summary.pdf","Please review and approve.", "Approver email","[Approval request],User().Email,User().FullName,PDFContent);
 
 
Although ExpandContainers: true, it is not working and only showing the screen as shown below. Is there anything wrong with the code? thanks a lot for your help. 
Categories:

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard