Skip to content
mini-softwarePublic

About

Lightweight, fast and native Office-to-PDF libraries and command-line tools for .NET

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

512 stars

Watchers

5 watching

Forks

Repository files navigation

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

  • No office suite required: conversion runs inside your application or CLI.
  • Small deployment surface: minimal dependencies and no external process.
  • Server and CI friendly: works in containers, cloud services, and pipelines.
  • Open development: Apache 2.0 licensed with reproducible visual benchmarks.

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

See the contribution guide for setup, tests, and reviews. 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
Community governance Decisions, roles, voting, and maintainer selection
Roadmap Project scope, implementation status, and current priorities
Security Private vulnerability reporting and supported versions
Contributing Development setup, tests, reviews, and provenance requirements
GitHub releases Packages and standalone binaries
Issues Bugs, compatibility reports, and feature requests

License

Apache License 2.0. Commercial use is welcome

About

Lightweight, fast and native Office-to-PDF libraries and command-line tools for .NET

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

512 stars

Watchers

5 watching

Forks

Releases

Sponsor this project

Contributors

Languages