Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 2.36 KB

File metadata and controls

64 lines (42 loc) · 2.36 KB

MiniPdf

NuGet NuGet Downloads GitHub stars License

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

A minimal, lightweight .NET library for converting office files to PDF.

Online Demo: https://mini-software.github.io/MiniPdf/

Features

  • Excel to PDF conversion (.xlsx)
  • Word to PDF conversion (.docx)
  • 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
  • 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");

// File to byte array
byte[] pdfBytes = MiniPdf.ConvertToPdf("data.xlsx");

// Stream to byte array
using var stream = File.OpenRead("data.xlsx");
byte[] pdfBytesFromStream = MiniPdf.ConvertToPdf(stream);

Benchmark

MiniPdf output is compared against LibreOffice as the reference renderer across 373 test cases.

Detailed reports:

Links