XAML to PDF (MAUI)

This example demonstrates how a MAUI page can be converted into a PDF document.

The IronPdf.Extensions.Maui package is an extension of the main IronPdf package. Both the IronPdf.Extensions.Maui and IronPdf packages are needed to render a content page from a MAUI application to a PDF document.

Rendering from a MAUI page will give you access to all the features offered by the RenderingOptions class. The resulting PDF document can then either be exported as a PDF file or viewed with a MAUI PDF viewer.

How to Convert XAML Files to PDFs in MAUI

  1. Install the C# library for converting XAML files to PDFs in C#
  2. Instantiate the ChromePdfRenderer class
  3. Use the RenderingOptions class to add text and HTML header and footer
  4. Use the RenderContentPageToPdf method to render XAML files to PDF
  5. Download the resulting PDF document to the desktop