Skip to content

diegorenatob/AlohaPDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌺 AlohaPDF

Create Beautiful PDFs with Aloha Spirit

Build and Test NuGet Downloads License: MIT .NET 9 codecov

A modern, intuitive PDF generator for .NET MAUI with tropical vibes.
Perfect for cross-platform mobile and desktop applications.

Getting Started β€’ Examples β€’ Docs β€’ Contribute


✨ Why AlohaPDF?

The Aloha Spirit - Creating PDFs should be welcoming, simple, and joyful. AlohaPDF brings that spirit to .NET MAUI.

  • 🌺 Simple & Intuitive - Fluent API that feels natural
  • 🎨 Beautiful by Default - Tropical color palette inspired design
  • πŸ“± Mobile-First - Built specifically for .NET MAUI
  • ⚑ Lightning Fast - Optimized for mobile performance
  • πŸ†“ 100% Open Source - MIT licensed, free forever
  • 🌴 Modern Design - Contemporary styling out of the box

πŸš€ Quick Start

Installation

dotnet add package AlohaPDF

Your First PDF

using AlohaPDF;
using AlohaPDF.Core;

var pdf = new AlohaPdfDocument();

pdf.Initialize(new PdfDocumentOptions 
{
    Title = "Welcome to AlohaPDF",
    Subtitle = "Creating PDFs with Aloha Spirit",
    PageSize = PageSize.A4,  // A4, Letter, Legal, A3, A5, Tabloid, Executive, B4, B5
    Orientation = PageOrientation.Portrait,  // Portrait or Landscape
    Info = new DocumentInfo
    {
        Author = "Your Name",
        CreatedDate = DateTime.Now
        // Displays as simple one-line: "Your Name β€’ Created on Feb 11, 2025"
    }
});

pdf
    .AddSection("Aloha!")
    .AddParagraph("Welcome to the easiest way to create PDFs in .NET MAUI!")
    .AddTable(
        headers: new[] { "Feature", "Status" },
        rows: new[]
        {
            new[] { "Beautiful Design", "βœ“" },
            new[] { "Easy to Use", "βœ“" },
            new[] { "Open Source", "βœ“" }
        },
        headerStyle: TableHeaderStyle.Primary
    );

pdf.Generate("aloha.pdf");

That's it! 🌺 You just created a beautiful PDF.

🎯 Key Features

πŸ“„ Rich Content

  • βœ… Sections & Subtitles
  • βœ… Paragraphs with styling
  • βœ… Tables (4 beautiful styles)
  • βœ… Lists (bullet & numbered)
  • βœ… Custom spacing
  • βœ… Lines & dividers

🎨 Tropical Design

  • βœ… Coral, ocean, palm colors
  • βœ… Modern typography
  • βœ… Custom fonts support
  • βœ… SVG/PNG/JPG logos
  • βœ… Zebra-striped tables
  • βœ… Rounded corners

πŸ”„ Smart Layout

  • βœ… Auto page breaks
  • βœ… Text wrapping
  • βœ… Repeating headers
  • βœ… Dynamic spacing
  • βœ… Multi-page support
  • βœ… Mobile-optimized

πŸ’» Developer Joy

  • βœ… Fluent, chainable API
  • βœ… IntelliSense support
  • βœ… XML documentation
  • βœ… Type-safe options
  • βœ… Zero setup
  • βœ… .NET 9 ready

πŸ“± Platform Support

Platform Status
🍎 iOS βœ… Fully Supported
πŸ€– Android βœ… Fully Supported
πŸͺŸ Windows βœ… Fully Supported
🍎 macOS βœ… Fully Supported

πŸ’‘ Examples

Tropical Color Tables

// Coral primary header
pdf.AddTable(headers, rows, headerStyle: TableHeaderStyle.Primary);

// Ocean blue accent
pdf.AddTable(headers, rows, headerStyle: TableHeaderStyle.Secondary);

// Dark professional
pdf.AddTable(headers, rows, headerStyle: TableHeaderStyle.Dark);

// Clean minimal
pdf.AddTable(headers, rows, headerStyle: TableHeaderStyle.Minimal);

Custom Fonts

var options = new PdfDocumentOptions
{
    Title = "Custom Font Report",
    Fonts = new FontOptions
    {
        Regular = await FileSystem.OpenAppPackageFileAsync("Fonts/Inter-Regular.ttf"),
        Bold = await FileSystem.OpenAppPackageFileAsync("Fonts/Inter-Bold.ttf")
    }
};

Logos

var options = new PdfDocumentOptions
{
    Title = "Company Report",
    HeaderLogo = await FileSystem.OpenAppPackageFileAsync("Images/logo.svg"),
    FooterLogo = await FileSystem.OpenAppPackageFileAsync("Images/logo-gray.svg")
};

🎨 Color Palette

AlohaPDF uses a tropical-inspired color scheme:

  • Primary (Coral): #FF6B35 - Warm and welcoming
  • Secondary (Ocean): #00A8CC - Professional and calm
  • Accent (Palm): #6BBF59 - Fresh and vibrant

πŸ“– Documentation

Core Methods

Method Description
Initialize(options) Set up your PDF
AddSection(text, pill) Add numbered section
AddSubtitle(text, pill) Add subtitle
AddParagraph(text, ...) Add text with wrapping
AddTable(headers, rows, ...) Add data table
AddList(items, ...) Add bullet/numbered list
Generate(path) Create the PDF file

Table Styles

  • Primary - Coral header (warm & inviting)
  • Secondary - Ocean header (professional)
  • Dark - Dark header (elegant)
  • Light - Light header (clean)
  • Minimal - Bottom border only

🏝️ Real-World Examples

Check out /samples for complete examples:

  • Sales Report - Professional business reports
  • Invoice - Beautiful invoices
  • Meeting Notes - Structured documents
  • Product Catalog - Multi-column layouts

🀝 Contributing

Aloha! We welcome contributions with open arms! πŸ€—

  1. πŸ› Report bugs - Help us improve
  2. πŸ’‘ Suggest features - Share your ideas
  3. πŸ“ Improve docs - Make it easier for others
  4. πŸ”§ Submit PRs - Code with Aloha spirit

See CONTRIBUTING.md for guidelines.

πŸ“„ License

MIT License - Copyright (c) 2025 Diego BelapatiΓ±o Farias

πŸ™ Acknowledgments

  • Built with SkiaSharp
  • SVG support by Svg.Skia
  • Inspired by tropical paradise 🏝️

⭐ Show Your Support

If AlohaPDF brings Aloha spirit to your project:

  • ⭐ Star this repository
  • 🐦 Share on social media
  • πŸ“ Write about it
  • πŸ’¬ Spread the Aloha!

Made with 🌺 Aloha Spirit by Diego Belapatiño Farias

Create PDFs with joy, not frustration 😊

Report Bug β€’ Request Feature β€’ Say Aloha

About

🌺 Create Beautiful PDFs with Aloha Spirit - A modern PDF generator for .NET MAUI

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages