SharpPdfGen 1.0.1

dotnet add package SharpPdfGen --version 1.0.1
                    
NuGet\Install-Package SharpPdfGen -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SharpPdfGen" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpPdfGen" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="SharpPdfGen" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SharpPdfGen --version 1.0.1
                    
#r "nuget: SharpPdfGen, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SharpPdfGen@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SharpPdfGen&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=SharpPdfGen&version=1.0.1
                    
Install as a Cake Tool

SharpPdfGen

NuGet Downloads License

A high-performance, cross-platform, open-source PDF generation library for .NET with full async support. Create, merge, split, and manipulate PDFs with ease.

✨ Features

  • 🚀 Async/await support - All operations are fully asynchronous
  • 🌍 Cross-platform - Works on Windows, Linux, and macOS
  • 📄 Multiple PDF types - Simple documents, multi-page, and tables
  • 🔓 Zero licensing costs - Completely free and open-source
  • 📦 Easy integration - Simple, intuitive API
  • 🎯 High performance - Optimized for speed and memory efficiency

🚀 Quick Start

Installation

dotnet add package SharpPdfGen

Basic Usage

using SharpPdfGen;

// Create a simple PDF
await WorkingPdfGenerator.CreateSimplePdfAsync(
    "My Document", 
    "Hello from SharpPdfGen!", 
    "output.pdf");

📖 Examples

Simple PDF Document

await WorkingPdfGenerator.CreateSimplePdfAsync(
    title: "Invoice #001",
    content: "Thank you for your purchase! Total: $299.99",
    outputPath: "invoice.pdf"
);

Multi-Page Document

string[] pages = {
    "Page 1: Introduction and overview of the project.",
    "Page 2: Technical specifications and requirements.",
    "Page 3: Implementation details and best practices."
};

await WorkingPdfGenerator.CreateMultiPagePdfAsync(
    title: "Project Documentation",
    pages: pages,
    outputPath: "documentation.pdf"
);

Table-Based PDF

string[] headers = { "Product", "Quantity", "Price", "Total" };
string[][] rows = {
    new[] { "Widget A", "10", "$25.00", "$250.00" },
    new[] { "Widget B", "5", "$45.00", "$225.00" },
    new[] { "Widget C", "3", "$75.00", "$225.00" }
};

await WorkingPdfGenerator.CreateTablePdfAsync(
    title: "Sales Report Q4 2024",
    headers: headers,
    rows: rows,
    outputPath: "sales-report.pdf"
);

Get PDF as Byte Array

byte[] pdfBytes = await WorkingPdfGenerator.GetPdfBytesAsync(
    title: "API Response",
    content: "Generated PDF content for web API response."
);

// Use bytes for web response, email attachment, etc.
return File(pdfBytes, "application/pdf", "document.pdf");

🛠 API Reference

WorkingPdfGenerator.CreateSimplePdfAsync

Creates a simple PDF document with title and content.

Parameters:

  • title (string) - Document title
  • content (string) - Main content text
  • outputPath (string) - File path for output
  • cancellationToken (CancellationToken, optional) - Cancellation support

WorkingPdfGenerator.CreateMultiPagePdfAsync

Creates a multi-page PDF document.

Parameters:

  • title (string) - Document title
  • pages (string[]) - Array of page content
  • outputPath (string) - File path for output
  • cancellationToken (CancellationToken, optional) - Cancellation support

WorkingPdfGenerator.CreateTablePdfAsync

Creates a PDF with a data table.

Parameters:

  • title (string) - Document title
  • headers (string[]) - Table column headers
  • rows (string[][]) - Table data rows
  • outputPath (string) - File path for output
  • cancellationToken (CancellationToken, optional) - Cancellation support

WorkingPdfGenerator.GetPdfBytesAsync

Returns PDF document as byte array.

Parameters:

  • title (string) - Document title
  • content (string) - Document content
  • cancellationToken (CancellationToken, optional) - Cancellation support

Returns: Task<byte[]> - PDF document as bytes

🌐 Compatibility

  • .NET 6.0 and higher
  • .NET 8.0 and higher
  • Windows, Linux, macOS
  • Any .NET application type (Web, Desktop, Console, API)

📋 Requirements

  • .NET 6.0 or .NET 8.0 runtime
  • No additional dependencies required

🤝 Contributing

We welcome contributions! Please visit our GitHub repository to:

  • 🐛 Report bugs
  • 💡 Request features
  • 🔧 Submit pull requests
  • 📚 Improve documentation

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

💖 Support

If SharpPdfGen helps your project, please ⭐ star the repository on GitHub!


Made with ❤️ by the SharpPdfGen team

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 109 8/13/2025
1.0.0 103 8/13/2025

v1.0.1: Added comprehensive README with examples and documentation