mirror of
https://github.com/fox0430/nim-podofo
synced 2026-01-01 23:11:26 +00:00
No description
| .github/workflows | ||
| examples | ||
| lowlevel | ||
| tests | ||
| .gitignore | ||
| LICENSE | ||
| podofo.nim | ||
| podofo.nimble | ||
| README.md | ||
nim-podofo
Nim bindings for PoDoFo library.
Requirements
Installtion
nimble install podofo
Usage
import pkg/podofo
# Create a new document
let doc = newPdfDocument()
# Create an A4 page
let page = doc.createPage(PdfPageSize.A4)
# Get a standard font
let font = doc.helvetica()
# Draw on the page
page.draw:
painter.setFont(font, 12)
painter.setFillColor(black())
painter.drawText("Hello, World!", 100, 700)
# Save the document
doc.save("output.pdf")
Build
podofo requires C++ compilation. Use nim cpp.
nim cpp yourfile.nim
Note
Add the following lines to your .nimble
backend = "cpp"
License
MIT