nimwkhtmltox

Nim bindings for wkhtmltox

Wrapper score 15/100 · tests present · no docs generated

Wraps a native library — check OS Compatibility below for platform-specific linking notes.

Summary

Latest Version Unknown
License LGPL-3.0-or-later
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:23

Installation

nimble install nimwkhtmltox
choosenim install nimwkhtmltox
git clone https://github.com/neroist/nim-wkhtmltox

OS Compatibility

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

Source

Repository https://github.com/neroist/nim-wkhtmltox
Homepage https://github.com/neroist/nim-wkhtmltox
Registry Source nimble_official

README

nim-wkhtmltox

Nim bindings to wkhtmltox.

Distributing

This library depends on the wkhtmltox DLL, so please package it when distributing your application.

You can use -d:wkImageLib and -d:wkPdfLib to control what directory the DLLs are looked for, for the image and pdf submodules respectively.

Get Started

You can get started with the examples listed here or in the examples/ directory.

Documentation

Follow libwkhtmltox's directly here (Archive)

Examples

To PDF:

import nimwkhtmltox/pdf

initPdf()

# from w3schools
let content = """
<!DOCTYPE html>
<html>
<head>
  <style>
    h1 {
      color: blue;
      font-family: verdana;
      font-size: 300%;
    }

    p  {
      color: red;
      font-family: courier;
      font-size: 160%;
    }
  </style>
</head>
<body>

  <h1>This is a heading</h1>
  <p>This is a paragraph.</p>

</body>
</html>
"""

let settings = createGlobalSettings()
settings.setGlobalSetting("out", "./index.pdf")

let conv =  createConverter(settings)

let objSettings = createObjectSettings()

conv.addObject(objSettings, content)

conv.convert()

deinitPdf()
import nimwkhtmltox/pdf

initPDF()

toPDF(
  "https://wkhtmltopdf.org/libwkhtmltox/pagesettings.html",
  createGlobalSettings({
    "out": "pagesettings.pdf"
  })
)

deinitPDF()

To Image:

import nimwkhtmltox/image

initImage()

let settings = createGlobalSettings()
settings.setGlobalSettings({
  "in": "https://spdx.org/licenses/LGPL-3.0-or-later.html",
  "out": "license.png",
  "fmt": "png"
})

let conv = createConverter(settings, "")

conv.convert()

deinitImage()
import nimwkhtmltox/image

initImage()

toImage(
  "https://github.com/neroist/nim-wkhtmltox",
  createGlobalSettings({
    "out": "nim-wkhtmltox.png",
    "fmt": "png"
  })
)

deinitImage()