How to Use the PDF Viewer in Power Apps
Add the experimental PDF Viewer to a canvas app, display hosted or generated PDFs, troubleshoot loading errors, and automate sharing.
Direct answer: In a Power Apps canvas app, choose Insert > PDF viewer (experimental), then set the control’s Document property to either a direct, anonymous HTTPS URL ending in a PDF file or a PDF value produced by the experimental PDF() function. The hosted file must allow cross-origin requests from Power Apps. Redirects, HTML viewer pages, HTTP URLs, authentication-protected files, and unsupported PDF content will not load.
What the PDF Viewer supports
The PDF Viewer is an experimental canvas-app control that displays PDF content. It can show hosted documents or PDFs generated from the currently visible screen or a supported control. Printing and execution of embedded scripts and buttons are not supported. When the control cannot open a file, use its external-browser option.
Display a hosted PDF
- Open your canvas app in Power Apps Studio.
- Select Insert > PDF viewer (experimental).
- Select the control and set
Documentto a quoted HTTPS URL that resolves directly to a PDF.
"https://example.com/files/invoice-1042.pdf"
The URL must return the PDF bytes directly. It cannot first redirect to a login page, HTML document viewer, or download screen. The server must permit anonymous access and allow the required cross-origin requests from powerapps.com.
Useful viewer properties
| Property | Use |
|---|---|
Document |
Direct PDF URL or generated PDF value. |
Page |
Page to display. |
PageCount |
Total pages reported by the document. |
CurrentPage |
Currently selected page. |
Zoom, ActualZoom |
Control or read zoom level. |
FindText, CurrentFindText |
Set and read search text. |
FindNext, FindPrevious |
Move through search matches. |
ShowControls |
Shows the viewer menu, including external-browser fallback. |
DisplayMode, Visible |
Control interaction and visibility. |
OnSelect, OnStateChange |
Respond to interaction and loading state changes. |
Tooltip, Width, Height, X, Y |
Accessibility text and layout. |
Add navigation controls
For a custom next-page button, set its OnSelect property to:
Set(varPage, Min(PDFViewer1.PageCount, PDFViewer1.CurrentPage + 1));
Set the viewer’s Page property to varPage. A previous-page button can use:
Set(varPage, Max(1, PDFViewer1.CurrentPage - 1));
You can also expose search by setting FindText from a text input and calling FindNext. Documented keyboard shortcuts include J and N for page down, K for page up, and R to rotate all pages 90 degrees clockwise.
Generate a PDF inside Power Apps
The separate experimental PDF function generates a PDF from the contents of the currently visible screen or certain supported controls.
- In Power Apps Studio, open Settings > Upcoming features > Experimental.
- Enable PDF function.
- Add a button and generate the file in its
OnSelectproperty. - Bind the PDF Viewer’s
Documentproperty to the variable.
Set(myPDF, PDF(SubmitInspectionScreen));
Set the PDF Viewer’s Document property to:
myPDF
The function targets only the screen currently visible. To capture a smaller area, target a container or gallery:
Set(myPDF, PDF(InspectionContainer));
If the generated output contains a black rectangle, target the content container or gallery instead of a screen that also contains the PDF Viewer. This prevents the viewer itself from being captured recursively.
Send or store a generated PDF
Email with Outlook
Use the generated PDF as attachment content with the Office 365 Outlook connector:
Office365Outlook.SendEmailV2(
"recipient@example.com",
"Inspection report",
"Attached is the generated report.",
{
Attachments: Table({
Name: "inspection-report.pdf",
ContentBytes: PDF(SubmitInspectionScreen)
})
}
)
Power Automate and SharePoint
- Create a flow with the PowerApps (V2) trigger.
- Add a File input and any required Text inputs.
- Call the flow from Power Apps and pass
PDF(SubmitInspectionScreen)as the file content. - Use SharePoint Create file to save the PDF.
Why a hosted PDF may not load
| Symptom | Likely cause | Fix |
|---|---|---|
| Nothing renders | URL uses HTTP. | Use HTTPS. |
| Viewer shows a login page | File requires authentication. | Provide an anonymously accessible PDF or use an external browser workflow that handles authentication. |
| HTML appears instead of PDF | URL points to a viewer, redirect, or download page. | Use the direct PDF file URL and verify the response body is PDF data. |
| Works in a browser but not in Power Apps | CORS policy blocks Power Apps. | Configure the host to allow the required requests from powerapps.com. |
| Some files fail while others work | File does not conform to the PDF 32000 specification or contains unsupported content. | Regenerate or validate the PDF and remove unsupported features. |
| Buttons or scripts do nothing | Embedded scripts and buttons are not executed. | Provide equivalent Power Apps controls or open the document externally. |
| No print option | Printing is unsupported by the experimental control. | Use the viewer’s external-browser option and print there. |
| Generated PDF is black | The screen target includes the PDF Viewer. | Pass a content container or gallery to PDF(). |
| Users cannot discover an external fallback | Viewer controls are hidden. | Set ShowControls to true. |
Accessibility and usability checklist
- Set
ShowControlstotrueso users can open a document externally. - Add a heading Label immediately before a PDF that has no title.
- Provide a visible document title, page indicator, and alternative route for users who cannot use the experimental control.
- Keep the viewer large enough for page controls and readable zoom.
- Do not assume embedded PDF buttons provide app navigation.
Performance and reliability considerations
- Use a stable HTTPS host that returns the PDF directly with a correct PDF content type.
- Keep files reasonably sized; large PDFs take longer to download and render in a canvas app.
- Generate only the screen or container required instead of an entire complex screen.
- Validate PDFs before sending them to users or flows.
- Because this is an experimental control, provide an external-browser fallback and test the experience in the clients your users actually run.
Or skip the browser setup
If your workflow starts with a web page and you need a clean PDF or image before displaying or distributing it, ScreenshotNeo provides a single-call capture API and PDF output. Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server lets Claude, Cursor, and other MCP clients call take_screenshot, get_page_info, and capture_pdf.
See the ScreenshotNeo API documentation for all options. This example captures a page as a PDF or image response, depending on the parameters you choose:
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)
r.raise_for_status()
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}`);
if (!res.ok) throw new Error(`ScreenshotNeo request failed: ${res.status}`);
const bytes = Buffer.from(await res.arrayBuffer());
There is a free tier of 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
FAQ
Can the PDF Viewer open a SharePoint-protected file?
Not directly when the file requires authentication. The viewer requires an anonymously accessible PDF URL. Use a workflow that produces an accessible copy or open the document in an authenticated external browser.
Can I print from the control?
No. Printing is unsupported. Use the external-browser fallback.
Can a PDF contain working form buttons or JavaScript?
No. Embedded scripts and buttons do not execute in the viewer.
Can I capture only part of a screen with PDF()?
Yes. Pass a supported container or gallery instead of the whole screen.
Why should I keep an external fallback?
The control is experimental and has incomplete accessibility support. External opening also handles printing and PDF features the viewer does not implement.


