libharu

library for libharu

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-22 05:28

Installation

nimble install libharu
choosenim install libharu
git clone https://github.com/z-kk/libharu

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
libharu - - - - - - -

Source

Repository https://github.com/z-kk/libharu
Homepage https://github.com/z-kk/libharu
Registry Source nimble_official

README

libharu

nim library for libharu

Usage

install hpdf library

# apt install libhpdf-dev
$ nimble install libharu

nim source

import libharu
## you can use libharu functions
let
  pdf = HPDF_New(nil, nil)
  page = HPDF_AddPage(pdf)
  font = HPDF_GetFont(pdf, HPDF_DEF_FONT, nil)
  fileName = "test.pdf"
var sts: HPDF_STATUS
sts = HPDF_Page_SetFontAndSize(page, font, HPDF_DEF_FONTSIZE)
sts = HPDF_Page_BeginText(page)
sts = HPDF_Page_TextOut(page, 10, 10, cstring(fileName))
sts = HPDF_Page_EndText(page)
sts = HPDF_SaveToFile(pdf, cstring(fileName))
HPDF_Free(pdf)

## or original nim functions written to libharu.nim
let
  pdf = newPdfDoc()
  page = pdf.addPage
  font = pdf.getFont(HPDF_DEF_FONT)
  fileName = "test.pdf"
page.setFont(font)
page.textOut(10, 10, fileName)
pdf.saveToFile(fileName)
pdf.free