Skip to main content

First Look: The new (experimental) PDF function for Microsoft Power Apps

by Arvind Khadye
Microsoft Dynamics 365 Developer | Head - PKC Development, proMX Software Technologies Pvt. Ltd.
December 19 2022

Wouldn't it be great if we could select a screen or portions of a screen to export to a PDF object?

The newly added experimental PDF function in Microsoft Power Apps allows makers to add a PDF export control to apps, allowing users to export contents of current screen to a PDF object so that it can be used in a variety of situation. Some of the possible use cases include triggering a Power Automate flow to store or distribute a PDF file, viewing the output in the app for review, or sending it as a file attachment.  

This function allows makers to create a PDF directly from Power Apps Screens, Galleries, or Containers.

With this technology, the PDF is generated on the device where the Power App is running. When you're creating a PDF, different devices, such as desktop computers and mobile devices, will have varying capacities.

An app may crash if you attempt to create a PDF with an exceptionally large file size that exceeds a device's storage capacity. When creating a PDF from an app, especially for apps meant to be used on a mobile device, consider the size, quantity, and amount of material you want to include.

Only content that is already on the screen when the PDF capability has been invoked can be used to create a PDF. For instance, if you added the PDF feature to screen 2, the resulting PDF will only contain the information from screen 2.

The PDF function syntax

PDF (Screen or control name [,{Size, DPI, Margin, Orientation, ExpandContainers}])

  • Screen or control name – Required. The screen or control name which contains the content to use to generate the PDF. Supported controls: Vertical Gallery, Vertical Layout Container, Horizontal Layout Container, Container, Screen.
  • Size – Optional. Controls the dimensions of the generated PDF.
  • DPI – Optional. Controls the scaling/resolution of the generated PDF. Must be greater than 0.
  • Margin – Optional. A string specifying the size of the space reserved between the content and the outer edge of the generated PDF.
  • Orientation – Optional. Represents orientation of the generated PDF, portrait (vertical) or landscape (horizontal) orientation. The default value is portrait (vertical).
  • ExpandContainers – Optional. Boolean. Controls whether certain containers with contents that exceed their allocated size expand to display all content in the generated PDF. The default value is false.

How to enable PDF function?

Follow these steps to enable PDF function:

1. Open your canvas app

2. Select Settings in Power Apps Studio

3. Select Upcoming features

powerapps-pdf-2.png

4. Select Experimental and scroll down to PDF function and turn it On

FREE Membership Required to View Full Content:

Joining MSDynamicsWorld.com gives you free, unlimited access to news, analysis, white papers, case studies, product brochures, and more. You can also receive periodic email newsletters with the latest relevant articles and content updates.
Learn more about us here

About Arvind Khadye
More about Arvind Khadye