ShreePdf 1.6.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ShreePdf --version 1.6.0
                    
NuGet\Install-Package ShreePdf -Version 1.6.0
                    
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="ShreePdf" Version="1.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ShreePdf" Version="1.6.0" />
                    
Directory.Packages.props
<PackageReference Include="ShreePdf" />
                    
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 ShreePdf --version 1.6.0
                    
#r "nuget: ShreePdf, 1.6.0"
                    
#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 ShreePdf@1.6.0
                    
#: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=ShreePdf&version=1.6.0
                    
Install as a Cake Addin
#tool nuget:?package=ShreePdf&version=1.6.0
                    
Install as a Cake Tool

<div align="center">

<img src="logo.png" width="380" alt="ShreePdf Engine Logo"><br><br>

โšก ShreePdf Engine

Radiant Aesthetics. Intelligent PDF Engineering for the AI Era.

Build & Test NuGet Package Test Suite Target Framework Rendering Engine License

A next-generation C# PDF document generation library featuring universal Markdown ingestion, anti-orphan page budgeting, AI/RAG dual-stream metadata embedding, out-of-the-box themes, and SkiaSharp vector rendering.


</div>

๐Ÿš€ 4 Core Innovations of ShreePdf

1. ๐Ÿค– Universal Markdown & HTML Ingestion Engine

Render LLM outputs (GPT-4o, Claude, Gemini) and HTML/Razor views directly into PDF document AST without HTML wrappers or headless browser overhead.

var doc = Document.FromMarkdown(llmMarkdownText, ThemePresets.GlassmorphicDark);
doc.AddHtml("<h1 style='color:#a855f7;'>Razor & HTML View Support</h1>");

2. ๐Ÿ“ Anti-Orphan Smart Auto-Fit Budgeter

Eliminates 1.05-page documents spilling 1โ€“3 orphan lines onto a blank second page. It dynamically micro-adjusts typography spacing, line heights, and padding by 5โ€“12% to fit content cleanly on 1 page.

doc.EnableAutoFit(true);

3. ๐Ÿง  AI / RAG Dual-Stream Metadata Embedder

Embeds a structured JSON AST directly inside the PDF binary metadata stream (RagMetadataManager). Downstream AI agents and vector databases extract data with 100% loss-free accuracy without OCR.

// Extract loss-free AST JSON directly from PDF bytes
string astJson = RagMetadataManager.ExtractAstJsonFromPdfBytes(pdfBytes);

4. ๐ŸŽจ Out-of-the-Box Modern Theme Engine

Eliminates ugly default PDFs by bundling modern themes (ThemePresets.SaaSAnalytics, ExecutiveMinimal, GlassmorphicDark).

doc.WithTheme(ThemePresets.SaaSAnalytics);

๐Ÿงช Quality Assurance & Test Coverage Dashboard

ShreePdf features an extensive unit test suite verifying layout math, color models, HTML tag parsing, and cryptographic security.

Test Category Covered Components Test Count Status
๐Ÿ“„ Document & Fluent API Page sizes (A4โ€“B5), margins, themes, text elements, font scaling 74 โœ… 100% Passed
๐Ÿ“Š Visual Components & Widgets KPI Stat Cards, DataGrid pagination, status badges, stress tests 51 โœ… 100% Passed
๐Ÿ“ Layout & Auto-Fit Budgeter Page budgeting, orphan squeeze algorithm, height measurement 44 โœ… 100% Passed
๐ŸŽจ Color & Theme Engine Hex formats (#abc, #rrggbb, #aarrggbb), RGB, RGBA, themes 40 โœ… 100% Passed
๐Ÿค– Markdown Ingestion Headers h1โ€“h6, blockquotes, tables, bullet lists, formatting tags 40 โœ… 100% Passed
๐ŸŒ ASP.NET Core & HTML Middleware HTML tag parsing, inline CSS styles, Razor views, PdfResult 33 โœ… 100% Passed
๐Ÿ›ก๏ธ Licensing & Security Engine HMAC-SHA256 signatures, RSA keys, tier capabilities, watermarks 19 โœ… 100% Passed
๐Ÿง  AI / RAG Dual-Stream Metadata JSON AST serialization, metadata stream injection, round-trip checks 15 โœ… 100% Passed
๐Ÿงฉ Phase 2.5 Features (P0โ€“P2) Images, hyperlinks, lists, page numbers, landscape, watermarks, table splitting, async, templating, per-cell styling, streaming 63 โœ… 100% Passed
Total Test Suite Full Solution Suite 379 โœ… ALL PASSED

๐Ÿ’ป Quickstart

using ShreePdf.Fluent;
using ShreePdf.Licensing;
using ShreePdf.Metadata;
using ShreePdf.Web;

// 1. Set License
LicenseManager.SetLicenseKey("SHREE-ENTERPRISE-...");

// 2. Ingest Markdown, Add HTML & Apply Dark Theme
string llmText = "# Quarterly Review\n> Loss-free RAG indexing enabled.\n- Fast SkiaSharp rendering";
var doc = Document.FromMarkdown(llmText, ThemePresets.GlassmorphicDark)
    .AddHtml("<p style='color:#10b981; font-weight:bold;'>ASP.NET Core Razor Middleware Ready</p>")
    .EnableAutoFit(true)
    .EnableRagMetadata(true);

// 3. Export PDF & Extract RAG JSON
byte[] pdfBytes = doc.GenerateBytes();
string ragJson = RagMetadataManager.ExtractAstJsonFromPdfBytes(pdfBytes);
doc.Save("Report.pdf");

๐Ÿงช Running Tests & Samples

# Build Solution
dotnet build

# Run Full 316-Test Suite
dotnet test

# Run AI Showcase Console Application
dotnet run --project samples/ShreePdf.ConsoleSample

<div align="center">

Developed with โค๏ธ under jjopensoftworks-blip

</div>

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.16.0 95 8/25/2026
1.15.0 94 8/23/2026
1.14.0 99 8/19/2026
1.13.0 87 8/19/2026
1.12.0 84 8/19/2026
1.11.0 106 8/17/2026
1.10.0 102 8/15/2026
1.9.0 103 8/9/2026
1.8.0 97 8/9/2026
1.7.0 94 8/6/2026
1.6.0 112 8/4/2026
1.5.0 101 8/6/2026
1.3.0 110 8/1/2026
1.0.0 100 7/31/2026