MiniPdf README

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

Lightweight, fast and native Office-to-PDF libraries and command-line tools for Rust, .NET, Java, Python, JS, and Go.

NuGet crates.io Maven Central PyPI npm Go Reference GitHub stars DOI License

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

Online Demo · Releases · Report an issue

Your star or donation can make MiniPdf better

🤝 Looking for co-developers: Quick contribution

MiniPdf converts Office documents directly to PDF without Microsoft Office, LibreOffice, Adobe Acrobat, or COM automation at runtime.

Choose an implementation

Implementation Inputs Interfaces Maturity Documentation Visual results
.NET XLSX, DOCX, PPTX Library, CLI, Native AOT binaries Stable .NET guide XLSX
DOCX
PPTX
Rust XLSX, DOCX, PPTX Crate, CLI Stable Rust guide XLSX
DOCX
Java XLSX, DOCX, PPTX Library, CLI Experimental Java source XLSX
DOCX
Python DOCX Package, CLI Stable Python guide XLSX
DOCX
Node.js XLSX, DOCX, PPTX Native package Stable Node.js guide XLSX
DOCX
Go XLSX, DOCX, PPTX Package, CLI Experimental Go guide XLSX

Quick start

.NET

dotnet add package MiniPdf
using MiniSoftware;

MiniPdf.ConvertToPdf("report.docx", "report.pdf");

Prefer a command-line tool?

dotnet tool install --global MiniPdf.Cli
minipdf report.docx -o report.pdf

See the .NET guide for usage.

Rust

cargo add minipdf
cargo install minipdf-cli
minipdf::convert_to_pdf("report.docx", "report.pdf")?;
minipdf report.docx -o report.pdf

See the Rust guide for usage.

Java

Maven Central artifact

import io.github.minisoftware.minipdf.MiniPdf;
import java.nio.file.Files;
import java.nio.file.Path;

try {
	MiniPdf.registerFont(
			"Noto Sans",
			Files.readAllBytes(Path.of("fonts/NotoSans-Regular.ttf")));
	MiniPdf.convertToPdf(Path.of("report.docx"), Path.of("report.pdf"));
} finally {
	MiniPdf.clearRegisteredFonts();
}

See the Java guide for usage.


```python
import minipdf

minipdf.convert_to_pdf("report.docx", "report.pdf")

See the Python guide for usage.

Node.js

npm install minipdf
const minipdf = require('minipdf')

minipdf.convertToPdf('report.docx', 'report.pdf')

See the Node.js guide for usage.

Go

go get github.com/mini-software/MiniPdf/minipdf-go@latest
import minipdf "github.com/mini-software/MiniPdf/minipdf-go"

if err := minipdf.ConvertToPDF("report.docx", "report.pdf"); err != nil {
	panic(err)
}

See the Go guide for usage.

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.

Quick contribution

Open a clean fork or clone in any coding agent, then paste this prompt into the agent chat:

Run the minipdf-contribution skill.

Project resources

Resource Description
Online demo Try conversion in a browser
.NET documentation Stable library and CLI usage
Rust documentation Experimental crate and CLI usage
Java implementation Experimental Maven library and CLI source
Python documentation Experimental package and CLI usage
Node.js documentation Experimental native package usage
Go documentation Experimental package and CLI usage
.NET XLSX benchmark Visual comparison results for spreadsheets
.NET DOCX benchmark Visual comparison results for documents
Rust XLSX benchmark Rust spreadsheet visual comparison results
Rust DOCX benchmark Rust document visual comparison results
Rust benchmark workflow Generate fixture coverage and comparison reports
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

MiniPdf (mini-software/MiniPdf)

Searching Database…

这是什么?MiniPdf 是一套轻量、快速的本地库和命令行工具,可以把 Office 文档(XLSX、DOCX、PPTX)转换成 PDF,提供 .NET (C#)、Rust、Java、Python、Node.js 和 Go 等多种语言实现。
它是库、命令行工具,还是两者都有?两者都有。每种实现都以对应生态的库形式发布,大多数还附带命令行工具;.NET 版本另外还提供独立的 Native AOT 可执行文件。
怎么转换我的第一个文档?安装你所用语言对应的包,然后调用一个函数即可——Node.js:先执行 'npm install minipdf',再调用 minipdf.convertToPdf('report.docx','report.pdf');Go:执行 'go get github.com/mini-software/MiniPdf/minipdf-go@latest'。
使用它需要安装 Microsoft Office 吗?不需要任何 Office 组件——MiniPdf 直接转换文档,运行时不依赖 Microsoft Office、LibreOffice、Adobe Acrobat,也不使用 COM 自动化。
每种实现实际能转换哪些 Office 格式?输入格式支持各不相同:.NET 支持 XLSX、DOCX 和 PPTX;Rust 和 Java 支持 XLSX 和 DOCX;Python 包目前只能转换 DOCX——选择实现前请先确认你要的格式是否被支持。
可以在商业软件中使用吗?可以——它采用 Apache License 2.0,明确欢迎商业使用。
哪些语言的移植版本是稳定的,哪些还处于实验阶段?.NET、Rust、Python 和 Node.js 的实现标记为稳定,Java 和 Go 则是实验性的——Go 移植版目前只发布了 XLSX 的可视化验证结果。
不安装任何东西可以试用吗?可以,项目提供了在线演示,直接在浏览器里就能测试转换效果。
如何检查 PDF 输出的还原度?仓库提供了基准测试页面,展示 .NET 和 Rust 转换 XLSX 与 DOCX 的可视化对比结果,你可以在采用之前先查看渲染效果。
Size
1.9 GB
Stars
504
Age
7mo
Commits · 90 Days