MiniPdf README

The project's README from github.com/mini-software/MiniPdf. As one markdown file: README.md.

Office-to-PDF conversion for .NET.

NuGet GitHub stars DOI License

English | 简体中文 | 繁體中文 | 日本語 | 한국어 | Italiano | Français

Online Demo · Releases · Report an issue

Contributions are welcome. See Contributing.

Convert XLSX, DOCX, and PPTX files with the .NET library, command-line tool, or standalone Native AOT builds. Microsoft Office, LibreOffice, Adobe Acrobat, and COM automation are not required at runtime.

.NET overview

Implementation Inputs Interfaces Maturity Documentation Visual results
.NET XLSX, DOCX, PPTX Library, CLI, Native AOT binaries Stable .NET guide XLSX
DOCX
PPTX

Quick start

Install the library

dotnet add package MiniPdf
using MiniSoftware;

MiniPdf.ConvertToPdf("workbook.xlsx", "workbook.pdf");
MiniPdf.ConvertToPdf("report.docx", "report.pdf");
MiniPdf.ConvertToPdf("slides.pptx", "slides.pdf");

byte[] pdfBytes = MiniPdf.ConvertToPdf("report.docx");

Use the command line

dotnet tool install --global MiniPdf.Cli
minipdf report.docx -o report.pdf
minipdf workbook.xlsx -o workbook.pdf --compress
minipdf slides.pptx -o slides.pdf
minipdf --help

Standalone builds run without an installed .NET runtime. Download a Native AOT binary from Releases.

Usage examples

Convert streams

using System.IO;
using MiniSoftware;

using var input = File.OpenRead("report.docx");
using var output = File.Create("stream-output.pdf");
MiniPdf.ConvertToPdf(input, output);

Dispose the input and output streams in the calling code. Use the overload returning byte[] when an in-memory result is needed.

Select Excel sheets and control layout

using MiniSoftware;

MiniPdf.ConvertToPdf("workbook.xlsx", "summary.pdf", new MiniPdfConversionOptions
{
    Sheets = new[] { "Summary" },
    Landscape = true,
    FitToPage = true,
    Compress = true,
});

Sheet names, 1-based SheetIndexes, orientation, print scale, and fit-to-page options apply to XLSX input. See the conversion options for the complete list.

Set Word page size and margins

using MiniSoftware;

MiniPdf.ConvertToPdf("report.docx", "a4-report.pdf", new MiniPdfConversionOptions
{
    PageSize = MiniPdfPageSize.A4,
    Margins = new MiniPdfMargins(left: 36, top: 48, right: 36, bottom: 48),
});

PageSize and Margins apply to DOCX input. Dimensions use PDF points: 72 points equal one inch. They do not override XLSX worksheet or PPTX slide sizes.

Reduce memory for large, simple Excel tables

using System.IO;
using MiniSoftware;

using var input = File.OpenRead("workbook.xlsx");
using var output = File.Create("low-memory.pdf");
MiniPdf.ConvertToPdf(input, output, new MiniPdfConversionOptions
{
    LowMemory = true,
    Compress = true,
});

Low-memory XLSX conversion requires writable temporary storage. Features such as formulas, merged cells, and drawings are unsupported and return an error; there is no automatic fallback. Read the supported features and limitations before enabling it. Returning byte[] still retains the complete PDF in memory.

Provide fonts for headless hosts

using System.IO;
using MiniSoftware;

MiniPdf.RegisterFont("Arial", File.ReadAllBytes(Path.Combine("Fonts", "arial.ttf")));
MiniPdf.ConvertToPdf("report.docx", "font-report.pdf");

Supply licensed .ttf or .ttc files that contain the required glyphs. Register fonts once at application startup: registrations are process-wide. MiniPdf does not distribute these font files.

See the .NET library guide and CLI reference for more examples and options.

Why MiniPdf

MiniPdf targets practical document conversion, not complete Microsoft Office layout compatibility. Complex templates may render differently; use the online demo or benchmark reports to evaluate representative files.

Contributing

Submit changes through pull requests. For bug reports, include a small input file and the steps needed to reproduce the problem.

Project resources

Resource Description
Online demo Try conversion in a browser
.NET documentation Stable library and CLI usage
CLI reference Commands, fonts, compression, and Excel preview options
.NET XLSX benchmark Visual comparison results for spreadsheets
.NET DOCX benchmark Visual comparison results for documents
GitHub releases Packages and standalone binaries
Issues Bugs, compatibility reports, and feature requests

License

Apache License 2.0. Commercial use is welcome

MiniPdf (mini-software/MiniPdf)

xlsx
Searching Database…

What is this?MiniPdf is a family of lightweight, fast, native libraries and CLI tools that convert Office documents (XLSX, DOCX, PPTX) to PDF, with implementations for .NET (C#), Rust, Java, Python, Node.js and Go.
Is this a library, a CLI, or both?Both. Each implementation ships as a library package for its ecosystem, and most also come as a command-line tool; the .NET version additionally offers standalone Native AOT binaries.
How do I convert my first document?Install the package for your language and call one function — for Node.js: 'npm install minipdf', then minipdf.convertToPdf('report.docx','report.pdf'); for Go: 'go get github.com/mini-software/MiniPdf/minipdf-go@latest'.
Do I need Microsoft Office installed for this to work?No Office stack needed — MiniPdf converts documents directly, without Microsoft Office, LibreOffice, Adobe Acrobat, or COM automation at runtime.
Which Office formats can each implementation actually convert?Input support varies: .NET covers XLSX, DOCX and PPTX; Rust and Java cover XLSX and DOCX; the Python package currently converts DOCX only — so check your format against the implementation you pick.
Can I use it in commercial software?Yes — it is Apache License 2.0, and commercial use is explicitly welcome.
Which language ports are stable and which are still experimental?.NET, Rust, Python and Node.js implementations are marked stable, while Java and Go are experimental — the Go port currently publishes verified visual results for XLSX only.
Can I try it without installing anything?Yes, the project links an online demo where you can test conversions right in the browser.
How can I check how faithful the PDF output is?The repo publishes benchmark pages with visual comparison results for XLSX and DOCX conversions in .NET and Rust, so you can inspect rendered output before committing.
Size
1.9 GB
Stars
512
Age
9mo
Commits · 90 Days