mirror of
https://github.com/fox0430/nim-qpdf
synced 2026-01-01 23:11:23 +00:00
No description
| .github/workflows | ||
| examples | ||
| lowlevel | ||
| tests | ||
| .gitignore | ||
| LICENSE | ||
| qpdf.nim | ||
| qpdf.nimble | ||
| README.md | ||
nim-qpdf
Nim bindings for the qpdf C++ library.
Requirements
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"