No description
Find a file
2025-12-03 23:22:12 +09:00
.github/workflows Add basic example (#7) 2025-11-29 05:03:49 +09:00
examples Add basic example (#7) 2025-11-29 05:03:49 +09:00
lowlevel Add basic example (#7) 2025-11-29 05:03:49 +09:00
tests Fix tests (#3) 2025-11-29 04:00:52 +09:00
.gitignore Add basic example (#7) 2025-11-29 05:03:49 +09:00
LICENSE Initial commit 2025-11-29 02:37:52 +09:00
qpdf.nim macOS support (#4) 2025-11-29 04:36:54 +09:00
qpdf.nimble ci: Add tests workflow (#2) 2025-11-29 04:10:46 +09:00
README.md Update README.md (#9) 2025-12-03 23:22:12 +09:00

nim-qpdf

Nim bindings for the qpdf C++ library.

Requirements

  • Nim 2.0.6+
  • qpdf 11.0+ (libqpdf-dev)

Installtion

nimble install qpdf

Usage

import pkg/qpdf

# Create new PDF
var pdf = newPdf()

# Basic info
echo "Pages: ", pdf.numPages
echo "Version: ", pdf.version

# Add embedded file
pdf.addEmbeddedFile("data.txt", "content", "text/plain")

# Save
pdf.save("output.pdf")

# Or save to memory
let bytes = pdf.saveToMemory()

Build

nim cpp -r yourfile.nim

Note

Add the following lines to your .nimble

backend = "cpp"