SharpPdfGen 1.0.1
dotnet add package SharpPdfGen --version 1.0.1
NuGet\Install-Package SharpPdfGen -Version 1.0.1
<PackageReference Include="SharpPdfGen" Version="1.0.1" />
<PackageVersion Include="SharpPdfGen" Version="1.0.1" />
<PackageReference Include="SharpPdfGen" />
paket add SharpPdfGen --version 1.0.1
#r "nuget: SharpPdfGen, 1.0.1"
#:package SharpPdfGen@1.0.1
#addin nuget:?package=SharpPdfGen&version=1.0.1
#tool nuget:?package=SharpPdfGen&version=1.0.1
SharpPdfGen
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 titlecontent
(string) - Main content textoutputPath
(string) - File path for outputcancellationToken
(CancellationToken, optional) - Cancellation support
WorkingPdfGenerator.CreateMultiPagePdfAsync
Creates a multi-page PDF document.
Parameters:
title
(string) - Document titlepages
(string[]) - Array of page contentoutputPath
(string) - File path for outputcancellationToken
(CancellationToken, optional) - Cancellation support
WorkingPdfGenerator.CreateTablePdfAsync
Creates a PDF with a data table.
Parameters:
title
(string) - Document titleheaders
(string[]) - Table column headersrows
(string[][]) - Table data rowsoutputPath
(string) - File path for outputcancellationToken
(CancellationToken, optional) - Cancellation support
WorkingPdfGenerator.GetPdfBytesAsync
Returns PDF document as byte array.
Parameters:
title
(string) - Document titlecontent
(string) - Document contentcancellationToken
(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.
🔗 Links
- 📦 NuGet Package: https://www.nuget.org/packages/SharpPdfGen/
- 📂 Source Code: https://github.com/vtoxi/SharpPdfGen
- 🌐 Documentation: https://vtoxi.github.io/SharpPdfGen
- 🐛 Issues: https://github.com/vtoxi/SharpPdfGen/issues
💖 Support
If SharpPdfGen helps your project, please ⭐ star the repository on GitHub!
Made with ❤️ by the SharpPdfGen team
Product | Versions 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.0.1: Added comprehensive README with examples and documentation