Introduction to the PDF function in Power Apps

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.

Introduction to the PDF function in Power Apps Microsoft Office 365 PDF Function feacture

Using the PDF function

Now straight away you will be able to use the PDF function as shown below.

<img loading=”lazy” width=”571″ height=”724″ src=”https://i0.wp.com/sharepains.com/wp-content/uploads/2022/10/image-4.png?resize=571%2C724&ssl=1″ alt=”PDF Function used to generate PDF.

Set(result, PDF(Screen1))” class=”wp-image-174175″ title=”Introduction to the PDF function in Power Apps 2″ data-recalc-dims=”1″>

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.

Introduction to the PDF function in Power Apps Microsoft Office 365 image 5

The PDF function Options

So what are the options available?

Introduction to the PDF function in Power Apps Microsoft Office 365 image 6

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

Introduction to the PDF function in Power Apps Microsoft Office 365 image 9

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

Introduction to the PDF function in Power Apps Microsoft Office 365 image 10

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.

Introduction to the PDF function in Power Apps Microsoft Office 365 image 7

Continue Reading Pieter Veenstra’s Article on their blog

Introduction to the PDF function in Power Apps

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 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.

Blog Syndicated with Pieter Veenstra’s Permission

Author: Pieter Veenstra

Share This Post On
Share via
Copy link
Powered by Social Snap