Skip to main content

minpdf

Ultra fast, zero depedency, portable pdf engine written in C for JS/TS, client browser, Python, Golang and more.

Documentation · Installation · API · Roadmap · Contributing

CI npm License: MIT

C C++ Go Python Javascript TypeScript WebAssembly

[!WARNING] minpdf is under development. APIs may change.

The bindings use the same PDF engine and follow the same API. The library has no third-party runtime dependencies.

Installation

JavaScript and TypeScript

npm install minpdf

Node.js 18+, Bun, modern browsers, workers, and ESM bundlers are supported.

Python

python -m pip install minpdf-core

Go

go get github.com/actiledev/minpdf

The Go package uses cgo and requires CGO_ENABLED=1 and a C compiler.

C and C++

Copy include/minpdf.h into your project and define MINPDF_IMPLEMENTATION in one C translation unit, or compile core.c as a library.

cc -std=c11 -O2 app.c -o app

See the installation guide for more details.

Example

import { PDF, SIZES, rgb } from "minpdf";

const doc = await PDF.create(SIZES.A4);

try {
  doc
    .metadata({ title: "Hello minpdf", author: "minpdf" })
    .text("Hello, PDF!", 50, 55, { size: 24, weight: "bold" })
    .rect(50, 85, 240, 70, {
      fill: rgb(52, 152, 219),
      radius: 10,
    });

  await doc.save("hello.pdf");
} finally {
  doc.close();
}

Examples for other targets:

Features

  • PDF 1.4 output
  • A3, A4, A5, Letter, and custom page sizes
  • Text alignment and word wrapping
  • Built-in Helvetica fonts and embedded TrueType fonts
  • UTF-8 text with searchable Unicode maps
  • Rectangles, circles, lines, and simple tables
  • JPEG and non-interlaced 8-bit PNG images
  • Links, metadata, and multiple pages
  • File output, in-memory bytes, browser blobs, and downloads

minpdf creates new PDFs. It does not read, edit, merge, encrypt, sign, or render existing PDFs. See the roadmap for planned work.

Documentation

Contributing

Read CONTRIBUTING.md before opening a pull request. This project uses the Contributor Covenant. Report vulnerabilities as described in SECURITY.md.

Licensed under the MIT License.

Metadata

Release files for minpdf-core 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minpdf-core 0.1.0
File Size Uploaded
minpdf_core-0.1.0.tar.gz 22.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minpdf-core 0.1.0
File Interpreter ABI Platform
minpdf_core-0.1.0-cp39-abi3-macosx_10_15_universal2.whl CPython 3.9 abi3 macOS 10.15+ universal2 (ARM64, x86-64) Details

Total release size: 84.9 kB

Release files / minpdf_core-0.1.0.tar.gz

Download URL minpdf_core-0.1.0.tar.gz
Size 22.5 kB
Tags Source
SHA-256 checksum
How to use checksums
34c0f769b5aebdec33c2087ce11c37e5ff00f79eb736428f17d8a58c687bf690
BLAKE2b-256 checksum
How to use checksums
e1cb3c899b634b0be3cf3b0640ea833cfa79d4891b1cac379ce862efd5fe5b69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / minpdf_core-0.1.0-cp39-abi3-macosx_10_15_universal2.whl

Download URL minpdf_core-0.1.0-cp39-abi3-macosx_10_15_universal2.whl
Size 62.3 kB
Tags CPython 3.9 abi3 macOS 10.15+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
154b1d4471183712d8c438f16318c9e0a595f5f94dd781934605313cc4428733
BLAKE2b-256 checksum
How to use checksums
9ba1f9401533cceb9309baaeb3e0b234c8b18f2d59614876b6cb4cb1db711914
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page