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 / Generate a PDF from a ...
Power Apps
Unanswered

Generate a PDF from a Gallery

(0) ShareShare
ReportReport
Posted on by 18

Hey PowerAPPs Community i hope u are doing Well ! 

im trying to generate a pdf from a Gallery so i wrote this Code  it works but the problem as u see in the image below its not big enough and i dont know to much about the Option in the PDF function so Help 

 

Office365Outlook.SendEmailV2( 
 User().Email;
 "Livrable En Attente" ;" Voila le Livrable en Attente version PDF ";
 { 
 Attachments: Table( 
 { 
 Name: "Livrable_en_attente_ADMIN.pdf"; 
 ContentBytes: PDF(Gallery2_1;{Orientation:"Landscape";ExpandContainers: true}) 
 } 
 ) 
 } 
 ) 

 

this is the result:

meryem_gz_1-1694088007716.png

to much blank in the yellow part 

 

 

Categories:
I have the same question (0)
  • SagarVIS96 Profile Picture
    212 on at

    Hi @meryem_gz 

     

    You can check out this reference: https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-pdf#syntax . It has all the available properties which can be used in PDF function.

     

    Thanks

  • MarkRahn Profile Picture
    1,364 Super User 2026 Season 1 on at

    Hi @meryem_gz 

    I ran some tests to see if I could offer some help with this Experimental feature. There is not a lot in the way of parameters to play with.

     

    To play with this more, I added a New Screen and selected the Landscape print template. I dropped a Gallery on the Screen and linked it to a SharePoint List.

     

    I was not able to get my Gallery to show with as much white space as you have, but things definitely depended on the Width set for the Gallery. I also played with the Margin setting and the Size setting. Margin seems to help.

    ContentBytes: PDF(Gallery2,{Orientation:"Landscape",ExpandContainers: true, Margin:"5mm", Size:PaperSize.A4}) 

     

    I don't know if this will help you or not, but you could try setting the Width of the Gallery to a variable. Right before running your "SendEmailV2" code runs, change the varGalleryWidth variable to a larger or smaller value. After the "SendEmailV2" code runs, set the varGalleryWidth back to it's original value.

     

    Check the pdf that was generated. While testing, include the varGalleryWidth in you email.

     

    Hopefully with some trial and error, you can find something that works.

     

    -Mark

     

    If this helped you get to a solution, please click on Accept as Solution below

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 839

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 412

Last 30 days Overall leaderboard