Power Community

Power Community

Introduction to the PDF function in Power Apps

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

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.

PDF Function used to generate PDF.Set(result, PDF(Screen1))

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

This post was originally published on this site

- Advertisement -spot_img

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement - Advertisement

Latest News

Enable Early Access Wave 1 2023 | Power Platform

Like every 6 months, enabling Early Access is one of the best things to look forward to as Microsoft...

More Articles Like This

- Advertisement -spot_img