ScreenshotNeo

BlogHow-to

How to Download a PDF in Power Apps

Learn how to download existing PDFs, generate app screens as PDFs, preview them, email them, and save them to SharePoint from Power Apps.

By the ScreenshotNeo team1 October 20267 min read

Use Download("https://example.com/file.pdf") when the PDF already exists at a public URL. Use PDF(ScreenOrControl) when you need to generate a PDF from the current canvas-app content. The PDF function is experimental, runs on the device, and must be enabled first.

This guide covers downloading an existing file, generating a report from a screen, displaying a PDF inside the app, emailing it, and saving it to SharePoint with Power Automate.

1. Choose the right PDF workflow

What you have What you need Power Apps approach
An existing PDF URL Let the user save or open it Download(URL)
A screen, container, or gallery in the app Create a PDF from its current content PDF(ScreenOrControl)
A generated PDF object Show it inside the app PDF viewer control
A generated PDF object Email it Office365Outlook.SendEmailV2
A generated PDF object Store it durably Power Automate and SharePoint Create file

2. Download an existing PDF URL

Add a Button control and put this formula in its OnSelect property:

Download("https://example.com/file.pdf")

The URL must identify the PDF resource. On native Windows, Android, and iOS players, Power Apps prompts the user for a save location. In a web browser, the result depends on browser settings and pop-up blocking; PDFs commonly open in a new tab where the user can save them.

Use a URL stored in a control or variable

// Text input named PdfUrlInput
Download(PdfUrlInput.Text)
// URL stored in a variable
Set(pdfUrl, "https://example.com/file.pdf");
Download(pdfUrl)

Download() is a behavior function, so call it from an action such as a button’s OnSelect. It cannot authenticate the URL supplied to it. A protected SharePoint or other authenticated URL may therefore fail, especially in the mobile app. Use a URL that the device can request directly, or move the file operation into a connector or flow that has the required permissions.

Download checklist

  • Use HTTPS where the file is hosted.
  • Confirm the URL serves the PDF itself rather than an HTML viewer page or sign-in page.
  • Test the same URL on each supported platform.
  • Check browser pop-up settings when testing in the web player.
  • Do not assume a user’s Power Apps sign-in is forwarded to the URL.

3. Generate a PDF from a Power Apps screen

The PDF() function exports the visible content of a screen or supported control to a PDF object.

Enable the PDF function

  1. Open the app in Power Apps Studio.
  2. Open Settings.
  3. Select Upcoming features.
  4. Open Experimental.
  5. Turn on PDF function.

Microsoft documents this as an experimental feature, so validate the output on the devices and app versions you support before relying on it for a business process.

Minimal generation formula

Put this on a button’s OnSelect:

PDF(SubmitInspectionScreen)

The argument can be a screen, container, or gallery. The function captures content from the screen where it is invoked. To keep the generated object for a viewer, email action, or flow call, store it in a variable:

Set(myPDF, PDF(SubmitInspectionScreen))

Options for paper, quality, and layout

PDF() supports options including paper size, DPI, margins, orientation, and ExpandContainers. Use the options that match your report’s destination and test the resulting pagination. For example, a portrait report may need a different paper size or margins than a landscape inspection table. Keep the screen layout within the intended printable area and avoid relying on content that is not supported by the PDF function.

Generate and show a status message

Set(isGenerating, true);
Set(myPDF, PDF(InspectionDetails));
Set(isGenerating, false);
Notify("PDF ready", NotificationType.Success)

Bind a label’s Visible property to isGenerating if you want to show progress while the device builds the document.

4. Display a generated PDF inside the app

  1. Insert the experimental PDF viewer control.
  2. Set its Document property to myPDF.
  3. Generate the variable before navigating to the viewer screen.
// Generate on the first screen
Set(myPDF, PDF(InspectionDetails));
Navigate(PdfPreviewScreen)

For a hosted document, the PDF viewer requires an HTTPS URL that directly serves the PDF with anonymous access. Redirects, HTML document pages, restrictive CORS settings, and HTTP URLs are unsupported. Printing is not supported. If the control cannot render the document, users can open it in an external browser when that option is available.

5. Email the generated PDF

Add the Office 365 Outlook connector, then pass the PDF object as attachment content:

Office365Outlook.SendEmailV2(
    "recipient@example.com",
    "PDF report",
    "Attached is the generated report.",
    {
        Attachments: Table(
            {
                Name: "report.pdf",
                ContentBytes: PDF(SubmitInspectionScreen)
            }
        )
    }
)

If the same PDF is also needed for preview or SharePoint, generate it once and reuse the variable:

Set(myPDF, PDF(SubmitInspectionScreen));
Office365Outlook.SendEmailV2(
    RecipientInput.Text,
    "Inspection report",
    "Attached is the generated report.",
    {
        Attachments: Table(
            {
                Name: "inspection-report.pdf",
                ContentBytes: myPDF
            }
        )
    }
)

6. Save the PDF to SharePoint with Power Automate

Create the flow

  1. Create an instant cloud flow with the PowerApps (V2) trigger.
  2. Add a File input.
  3. Add a text input for the file name.
  4. Add the SharePoint Create file action.
  5. Select the site and document library where the connection has permission.
  6. Map the incoming file name and file content to the Create file fields.

Call the flow from Power Apps

After adding the flow to the app, pass the name and file object:

'PowerAppV2->Createfile'.Run(
    "NewInspectionReport.pdf",
    {
        file: {
            name: "NewInspectionReport.pdf",
            contentBytes: PDF(InspectionDetails)
        }
    }
)

For a reusable variable:

Set(myPDF, PDF(InspectionDetails));
'PowerAppV2->Createfile'.Run(
    "NewInspectionReport.pdf",
    {
        file: {
            name: "NewInspectionReport.pdf",
            contentBytes: myPDF
        }
    }
)

The flow writes the generated bytes to the SharePoint library using the flow connection’s permissions. Give the file a unique name when repeated submissions should create separate documents.

7. When the PDF is a webpage, skip local browser setup

If the source is a public webpage rather than app controls, ScreenshotNeo can return a PDF or image from one GET request. See the ScreenshotNeo API documentation for the available parameters.

Or skip the browser setup

Use this call when you need a PDF or screenshot of a URL instead of exporting a Power Apps screen:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

8. Troubleshooting

Symptom Likely cause Fix
Download opens nothing Pop-up blocking or browser policy Allow pop-ups for the app and test the URL directly in the browser.
Download works on desktop but fails on mobile The URL requires authentication that Download() cannot supply Use an accessible URL or a connector/flow that performs the authenticated request.
PDF formula is unknown The experimental feature is disabled Enable Settings > Upcoming features > Experimental > PDF function.
Generated PDF is blank or incomplete Unsupported content, wrong screen, or content has not finished loading Generate after the data is ready, target the correct screen or control, and test unsupported controls on each device.
App becomes slow or fails during generation Large output exceeds device capacity Reduce the captured area, simplify galleries, lower output settings, and test on lower-powered supported devices.
PDF viewer shows an error URL is HTTP, redirects, serves HTML, requires sign-in, or has restrictive CORS Use an HTTPS URL that directly serves the PDF with anonymous access.
Email action fails Outlook connector is missing or the attachment object is malformed Add the Office 365 Outlook connector and pass a table containing Name and ContentBytes.
SharePoint file is not created Flow input mapping or permissions are wrong Use a PowerApps (V2) File input, map the file name and bytes, and verify the SharePoint connection can write to the library.

9. Performance, reliability, and cost considerations

  • Device capacity: PDF generation happens on the device running the app. Large screens, galleries, and high-resolution output consume more memory and can fail on constrained devices.
  • Experimental status: Keep a fallback path, such as emailing or storing the source data, until your app’s PDF output is validated.
  • Authentication: A Power Apps user’s session does not automatically authenticate a URL passed to Download() or the PDF viewer.
  • Rendering readiness: Generate after records, images, and calculated values are loaded; otherwise the PDF can capture an intermediate state.
  • Repeated actions: Disable the generate button while work is in progress to avoid duplicate emails or SharePoint files.
  • Storage: Use deterministic names for replacement workflows and unique names for audit histories.
  • Cost: The Power Apps functions described here do not add a separate PDF-service charge, but connector, Power Automate, SharePoint, and licensing limits still apply to your environment. ScreenshotNeo has 1,000 free shots monthly with no card and paid plans from $5 for 3,000 shots.

10. FAQ

Can Power Apps download a PDF directly to a chosen mobile folder?

Native players prompt for a save location. The exact picker and behavior are controlled by the operating system.

Can Download() download a private SharePoint PDF?

It cannot authenticate the URL itself, so protected URLs may fail, particularly in mobile apps. Use a connector or flow for authenticated access.

Can I generate a PDF without enabling an experimental feature?

The documented PDF() function is experimental and disabled by default. Enable it in Upcoming features before using it.

Can the PDF viewer print?

Printing is not supported by the PDF viewer control. Users may open the document externally when rendering is unavailable.

Which method should I use for a compliance archive?

Generate the PDF, then save it through Power Automate to a SharePoint library where the flow connection has the required permissions.