PDFLib.Chromium
1.0.1
dotnet add package PDFLib.Chromium --version 1.0.1
NuGet\Install-Package PDFLib.Chromium -Version 1.0.1
<PackageReference Include="PDFLib.Chromium" Version="1.0.1" />
<PackageVersion Include="PDFLib.Chromium" Version="1.0.1" />
<PackageReference Include="PDFLib.Chromium" />
paket add PDFLib.Chromium --version 1.0.1
#r "nuget: PDFLib.Chromium, 1.0.1"
#:package PDFLib.Chromium@1.0.1
#addin nuget:?package=PDFLib.Chromium&version=1.0.1
#tool nuget:?package=PDFLib.Chromium&version=1.0.1
PDF Lib
An open source PDF library using .NET which focuses on rendering PDFs from HTML/CSS, and optionally signing them with digital signatures.
| File | Page Count |
|---|---|
| sample | 2 |
| medium | 140 |
| x2-large | 280 |
| x3-large | 420 |
Features
- Can reuse your frontend code to generate PDFs!
- Can sign PDFs with digital signatures
- Different wait strategies to use to indicate a page is ready for printing
The Journey:
This project started off as me being bored, a descent into madness. Was curious what it would take to create a PDF in C#. Quite the journey that was!
Initially I created a translation layer which converted Razor syntax into PDF syntax. However, it became obvious that styling and layouts were painful to do. As a developer, I felt I should be able to reuse the same frontend code to generate PDFs.
HTML/CSS to PDF became the focus. Manually creating the layout/renderer didn't sound reasonable when existing engines such as Blink (Chrome) and WebKit (Safari) already exist. Blink is pixel-perfect, what you see in the browser is what you get in the PDF. So I decided to use Blink!
Decided to leverage Chromium's headless shell, which requires using the Chromium Developer Protocol (CDP). Unfortunately, it uses base64 encoding on top of using JSON for communication. Thus, a 33% increase in data size off the rip.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- PDFLib.Razor (>= 1.0.0)
- System.Security.Cryptography.Pkcs (>= 10.0.2)
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 |
|---|