IRONSOFTWAREHOME
USE CASES

How to Export a MAUI XAML Page to PDF in .NET

Curtis Chau
Curtis Chau
Updated: July 5, 2026

.NET MAUI lets teams ship a single codebase across Windows and macOS, which makes it a popular choice for line-of-business desktop apps such as field service tools, point-of-sale systems, and operations dashboards. These apps already render structured screens in XAML, and users frequently need a copy of what they see as a portable document. IronPDF turns the current MAUI page into a PDF with one method call, so the UI a team already built becomes the report.

Where the need shows up

A field inspector finishes a job on a XAML form. A salesperson builds a quote on screen. A manager reviews a KPI dashboard. Each one ends the same way: someone wants a clean, shareable record for a client or the back office. Rebuilding that screen as a separate report template means two layouts that drift apart over time. Pointing the document straight at the existing page sidesteps that maintenance.

One page, one document

IronPDF renders a MAUI ContentPage to PDF through its Chrome engine, preserving fonts, colors, and layout. The RenderContentPageToPdf method handles the conversion, and the result is a standard PdfDocument ready to save or edit.

using IronPdf;
using IronPdf.Extensions.Maui;

private async void PrintToPdf(object sender, EventArgs e)
{
    ChromePdfRenderer renderer = new ChromePdfRenderer();
    renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter
    {
        HtmlFragment = "<h1>Inspection Report</h1>"
    };

    PdfDocument pdf = await renderer.RenderContentPageToPdf<MainPage, App>();
    pdf.SaveAs("inspection-report.pdf");
}

Wiring this to a button in the XAML file is all the UI work required:

<Button
    Text="Save as PDF"
    Clicked="PrintToPdf"
    HorizontalOptions="Center" />
XML

Before you wire it up

A few details determine whether the feature ships cleanly:

  • Extension package: RenderContentPageToPdf lives in the IronPdf.Extensions.Maui package, which sits on top of the main IronPdf package. Both are required.
  • Async handling: The method returns a task, so awaiting it keeps the interface responsive while a complex page renders. A loading indicator on the button improves the experience.
  • Save location: Use a file picker or a platform-appropriate directory rather than a hardcoded path, since the same code runs on Windows and macOS.
  • Platform scope: MAUI PDF generation targets desktop and web. Mobile platforms are not supported.

A button and a method call

That is the whole feature: one button, one call. Teams add invoice exports, inspection reports, and dashboard snapshots to a MAUI desktop app without a separate reporting layer. Because the output is a PdfDocument, further steps such as page numbers and compression are available before saving. Full method details are in the XAML to PDF guide.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Related Articles

Key in blue circle

Get your free 30-day Trial Key instantly.

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required