MiniPdf 0.41.1
dotnet add package MiniPdf --version 0.41.1
NuGet\Install-Package MiniPdf -Version 0.41.1
<PackageReference Include="MiniPdf" Version="0.41.1" />
<PackageVersion Include="MiniPdf" Version="0.41.1" />
<PackageReference Include="MiniPdf" />
paket add MiniPdf --version 0.41.1
#r "nuget: MiniPdf, 0.41.1"
#:package MiniPdf@0.41.1
#addin nuget:?package=MiniPdf&version=0.41.1
#tool nuget:?package=MiniPdf&version=0.41.1
MiniPdf for .NET
The stable MiniPdf implementation for converting Office files to PDF from .NET applications or the command line. It runs without Microsoft Office, LibreOffice, Adobe Acrobat, or COM automation.
Project home · Online demo · Rust implementation
Features
- Excel to PDF conversion (
.xlsx) - Word to PDF conversion (
.docx) - PowerPoint to PDF conversion (
.pptx) - Minimal dependencies — lightweight; relies almost entirely on built-in .NET APIs
- Serverless-ready — no COM, no Office installation, no Adobe Acrobat — runs anywhere .NET runs
- .NET library, global tool, and standalone Native AOT binaries
- Valid PDF 1.4 output
- 100% open-source & free — Apache 2.0 licensed, commercial use welcome; just keep the attribution. PRs & contributions are even better!
Install
dotnet add package MiniPdf
Usage
using MiniSoftware;
// Excel to PDF
MiniPdf.ConvertToPdf("data.xlsx", "output.pdf");
// Word to PDF
MiniPdf.ConvertToPdf("report.docx", "output.pdf");
// PowerPoint to PDF
MiniPdf.ConvertToPdf("slides.pptx", "output.pdf");
// File to byte array
byte[] pdfBytes = MiniPdf.ConvertToPdf("data.xlsx");
// Render selected Excel sheets by name or 1-based index
MiniPdf.ConvertToPdf("data.xlsx", "selected.pdf", new MiniPdfConversionOptions
{
Sheets = new[] { "Summary", "Details" },
SheetIndexes = new[] { 1, 3 },
});
// Stream to byte array
using var stream = File.OpenRead("data.xlsx");
byte[] pdfBytesFromStream = MiniPdf.ConvertToPdf(stream);
// Stream directly to another stream without allocating the complete PDF byte array
stream.Position = 0;
using var output = File.Create("output.pdf");
MiniPdf.ConvertToPdf(stream, output);
Conversion Options
MiniPdf.ConvertToPdf("data.xlsx", "compact.pdf", new MiniPdfConversionOptions
{
Sheets = new[] { "Summary", "Details" },
Compress = true,
FitToPage = true,
Landscape = true,
PrintScale = 70,
RowsPerPage = 80,
});
Sheet selection and layout options apply to XLSX input. Compress controls PDF
content-stream compression for every supported format.
Custom Fonts
Register TrueType .ttf or .ttc fonts once at application startup when the
host has limited system fonts, such as a container or Blazor WebAssembly app.
MiniPdf.RegisterFont("NotoSansSC", File.ReadAllBytes("Fonts/NotoSansSC-Regular.ttf"));
MiniPdf.ConvertToPdf("report.docx", "report.pdf");
Command Line
Install the .NET global tool:
dotnet tool install --global MiniPdf.Cli
minipdf report.docx -o report.pdf
Standalone Native AOT binaries for Windows, Linux, and macOS are available on the GitHub Releases page. See the CLI reference for commands and options.
Benchmark
MiniPdf output is compared against LibreOffice as the reference renderer across 373 test cases.
Detailed reports:
Links
- Project portal: https://github.com/mini-software/MiniPdf
- .NET CLI: https://www.nuget.org/packages/MiniPdf.Cli
- API source: https://github.com/mini-software/MiniPdf/blob/main/src/MiniPdf/MiniPdf.cs
- License: Apache-2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. 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 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- System.Memory (>= 4.5.5)
- System.ValueTuple (>= 4.5.0)
-
.NETStandard 2.0
- System.Drawing.Common (>= 8.0.0)
- System.Memory (>= 4.5.5)
-
net6.0
- System.Drawing.Common (>= 8.0.0)
-
net8.0
- System.Drawing.Common (>= 8.0.0)
-
net9.0
- System.Drawing.Common (>= 8.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MiniPdf:
| Package | Downloads |
|---|---|
|
Pek.MiniPdf
基于DH框架的Pdf处理库。基于https://github.com/mini-software/MiniPdf |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.41.1 | 208 | 9/4/2026 |
| 0.40.0 | 2,211 | 8/27/2026 |
| 0.39.0 | 497 | 8/23/2026 |
| 0.38.5 | 2,668 | 8/17/2026 |
| 0.38.4 | 1,756 | 8/14/2026 |
| 0.37.2 | 16,257 | 7/15/2026 |
| 0.36.2 | 5,925 | 7/8/2026 |
| 0.36.1 | 131 | 7/8/2026 |
| 0.35.2 | 1,628 | 7/6/2026 |
| 0.35.1 | 2,800 | 7/2/2026 |
| 0.34.1 | 1,566 | 6/27/2026 |
| 0.34.0 | 135 | 6/27/2026 |
| 0.33.0 | 143 | 6/27/2026 |
| 0.32.0 | 704 | 6/23/2026 |
| 0.31.0 | 11,875 | 6/5/2026 |
| 0.30.0 | 979 | 6/4/2026 |
| 0.29.0 | 24,449 | 4/30/2026 |
| 0.28.0 | 167 | 4/29/2026 |
| 0.27.0 | 134 | 4/28/2026 |
| 0.26.0 | 11,493 | 4/3/2026 |