Events
Powerful Devs Conference and Hack Together
Feb 12, 11 PM - Feb 28, 11 PM
Join the online conference and 2-week hackathon to explore building powerful solutions with Power Platform.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to: Canvas apps Model-driven apps
[This article is prerelease documentation and is subject to change.]
Export contents from the current screen to an object for use in multiple scenarios.
Important
The PDF function allows you to select a screen or portions of a screen for export to a PDF object (blob).
Different configuration options enable different outcomes for the resulting generated PDF.
Important
Note
PDF (Screen or control name [,{Size, DPI, Margin, Orientation, ExpandContainers}])
Screen or control name – Required. The screen or control containing 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. The default value depends on the app user's locale; Letter for US and Canada and A4 for other locales.
DPI – Optional. Controls the scaling/resolution of the generated PDF. Must be a value greater than 0. Content exceeding the space allowed by the specified margins may result in a higher effective DPI. The default value is 96.
Margin – Optional. A string specifying the size of the space reserved between the content and the outer edge of the generated PDF. Each margin of the generated PDF (top, right, bottom, left) can support a different value. Supported units of measurement for this value include in, cm, mm, pt, and px. The default value is 0.5 inch (12.7 mm) for all margins.
Orientation – Optional. Controls whether the generated PDF has a 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. Impacted controls include screens, containers, vertical and horizontal containers, vertical fixed-height galleries (not nested), forms, and scrollable canvas controls. The default value is false.
Formula | Description | Result |
---|---|---|
PDF(Screen1) | Generates a PDF object with the default settings. | A PDF object is created from the visible contents of Screen1. |
PDF(Container1, {Size: A3}) | Generates a PDF object with the paper size set to A3. | An A3-sized PDF object is created from the visible contents of Container1. |
PDF(Screen1, {DPI: 72, Margin: "25mm", Orientation: "Landscape"}) | Generates a PDF object with the resolution (DPI) set to 72, the margin set to 25 millimeters, and the orientation set to landscape (horizontal). | A PDF with the specified DPI, margin, and orientation is created in the default size (dependent on locale) from the visible content on Screen1. |
PDF(Screen1, {ExpandContainers: true}) | Generates a PDF object with applicable controls expanded. | A PDF is created where any containers/galleries with more content than is visible are expanded to show all content in the generated PDF. |
Certain controls aren't currently supported. These include charts, Power BI tile, Map, and some configurations of third-party PCF controls.
Nested Galleries aren't supported.
Non-Latin script types and font weights and styles such as bold and italic may not appear in the generated PDF for some fonts.
Creation of fillable PDFs isn't supported.
Events
Powerful Devs Conference and Hack Together
Feb 12, 11 PM - Feb 28, 11 PM
Join the online conference and 2-week hackathon to explore building powerful solutions with Power Platform.
Register now