Have you ever wanted to create a PDF from your Power Apps Screens? Now you can using a the new PDF function in Power Apps
Enabling the PDF Function
To enable this new experimental feature all you have to do is look for the PDF function feature in the Experimental tab and enable it.
Using the PDF function
Now straight away you will be able to use the PDF function as shown below.
Now the result variable is set to the content of the file. In the screenshot below I’m displaying the content in the PDF Viewer control, but you can of course do a lot more with it. If you generate a PDF, you might as well store the file in SharePoint or send it as an attachment in an email.
The PDF function Options
So what are the options available?
The PDF function isn’t documented yet. So it isn’t easy to figure out what the options are.
The only place where I ‘ve seen these documented is on a community blog page by Hiro
Ok, so we have a few options.
Orientation – You can set this to Landscape or Portrait.
Size – you have many options. If you type “Papersize.” the intellisense in Power Apps will do the rest for you
Margin – With the Margin property you have some control over the margins of your page. You will have to give 4 values. Left, Top, Right and Bottom.
DPI – This setting makes it possible to control the quality ( and the size) of your PDF.
Then the final option is Expand Containers. This last option needs a bit of a further explanation and also a warning.
Imagine if you have a Gallery ( or any other container with a scroll bar) and only some of the content is visible. you can now expand that content to make it possible to see all of the content within your PDF. Just set the ExpandContainers property to true.
But… Like I already mentioned the expand property does come with a warning.
As shown below I managed to expand my gallery, however the content following the container doesn’t move with it. So if you want to generate PODFs form your Power Apps Pages, be careful not to add any additional content underneath the container.