MauiPdfGenerator is a library for .NET MAUI that allows you to generate PDF documents using a fluent, declarative API designed to feel like a natural extension of the MAUI ecosystem. Stop learning complex, external PDF libraries and start creating documents with the same concepts, components, and development patterns you use every day.
Our philosophy is simple: if you know how to build a UI in .NET MAUI, you already know how to create a PDF with MauiPdfGenerator.
For a complete guide, examples, and advanced patterns, visit our official Wiki.
This is more than just a PDF library; it's a complete ecosystem designed to maximize your productivity and minimize frustration.
MauiPdfGenerator: The core engine, featuring a powerful layout system that emulates .NET MAUI's behavior for predictable results.MauiPdfGenerator.SourceGenerators: A smart code generator that eliminates "magic strings" for fonts, providing compile-time safety and IntelliSense for all your registered fonts.MauiPdfGenerator.Diagnostics: A first-class diagnostics library that transforms layout debugging from a guessing game into a science, providing clear, actionable feedback directly in your console and optionally as a visual overlay on the PDF itself.
Together, they provide a seamless and robust solution for creating professional PDFs, allowing you to focus on your application's logic, not on fighting with a new API.
- Fluent & Declarative API: Build complex documents with readable, chainable methods.
- MAUI-Native Components: Use familiar concepts like
Grid,VerticalStackLayout,Image, andParagraph. - Intelligent Layout System: The engine understands contextual defaults,
Margin,Padding, andLayoutOptionsjust like MAUI. - Automatic Pagination: Divisible elements like
ParagraphandGridflow across pages automatically, while atomic elements likeImageandStackLayoutmaintain their integrity. - Rich Styling: Customize fonts, colors, sizes, and text styles using the same
Microsoft.Mauitypes you already use. - Full Document Control: Define metadata, page size, orientation, and global styles with ease.
- Type-Safe Fonts: Automatically generates a static
PdfFontsclass from yourMauiProgram.csconfiguration. - Eliminate Typos:
PdfFonts.OpenSansBoldwill compile."OpenSans-Bold"might not. The generator ensures correctness at compile time. - Effortless Workflow: Just configure your fonts once and let the generator do the rest.
- Actionable Feedback: Get automatic, detailed feedback on common issues directly in your debug console and application logs by default.
- Visual Debugging: Optionally enable a powerful visual overlay that draws layout bounds, highlights overflow errors, and displays diagnostic codes directly on the generated PDF.
- Accelerate Development: Dramatically speed up the process of debugging complex layouts by seeing exactly what went wrong and where.
MauiPdfGenerator
MauiPdfGenerator.SourceGenerators
MauiPdfGenerator.Diagnostics
The project is under active development. We are continuously adding new features and improving existing ones based on community feedback.
This project thrives on community involvement. Your contributions are essential to its success.
- Star the Repository: If you find this project useful, giving it a star on GitHub is a powerful way to show your support and increase its visibility.
- Open Issues: Found a bug or have an idea for a feature that would improve your workflow? Open an issue. We value detailed reports and thoughtful suggestions.
- Pull Requests: We welcome code contributions. Whether it's a bug fix, a new feature, or improved documentation, feel free to fork the repository and submit a pull request.
This project is licensed under the terms of the LICENSE.txt file.