Skip to footer content
USING IRONPDF

Export MAUI Pages to PDF in .NET with IronPDF

.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");
}
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");
}
Imports IronPdf
Imports IronPdf.Extensions.Maui

Private Async Sub PrintToPdf(sender As Object, e As EventArgs)
    Dim renderer As New ChromePdfRenderer()
    renderer.RenderingOptions.HtmlHeader = New HtmlHeaderFooter With {
        .HtmlFragment = "<h1>Inspection Report</h1>"
    }

    Dim pdf As PdfDocument = Await renderer.RenderContentPageToPdf(Of MainPage, App)()
    pdf.SaveAs("inspection-report.pdf")
End Sub
$vbLabelText   $csharpLabel

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

<Button
    Text="Save as PDF"
    Clicked="PrintToPdf"
    HorizontalOptions="Center" />
<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.

Frequently Asked Questions

How do I export a MAUI page to PDF with IronPDF?

Install both the IronPdf and IronPdf.Extensions.Maui NuGet packages. Create a ChromePdfRenderer, call await renderer.RenderContentPageToPdf<TPage, TApp>(), and save the resulting PdfDocument.

Does IronPDF support MAUI on both Windows and macOS?

Yes. IronPDF's MAUI extension targets desktop platforms — Windows and macOS. Mobile platforms (iOS and Android) are not supported.

Do I need a separate report template to generate PDFs from a MAUI app?

No. IronPDF renders the existing XAML ContentPage to PDF through its Chrome engine, preserving fonts, colors, and layout. The page you already built becomes the document, with no duplicate template to maintain.

What NuGet packages do I need for MAUI PDF generation?

You need both IronPdf (the main package) and IronPdf.Extensions.Maui (the MAUI-specific extension). The RenderContentPageToPdf method is defined in the extension package.

Can I add headers, footers, or post-process the PDF after rendering a MAUI page?

Yes. RenderContentPageToPdf returns a standard PdfDocument object. You can add headers and footers through RenderingOptions.HtmlHeader or HtmlFooter before the call, and apply further edits such as page numbering or compression before saving.

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

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me