Description

Thin wrapper for wkhtmltox

Package Information

Version0.1.1 (2016-Dec-05)
Repositoryhttps://github.com/eBookingServices/wkhtmltox
LicenseMIT
CopyrightCopyright © 2016, Márcio Martins
AuthorsMárcio Martins
Registered byMárcio Martins
Dependenciesnone

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

wkhtmltox

Thin wrapper around wkhtmltopdf and wkhtmltoimage for the D language

Notes

-Currently only works on Posix systems

-Requires libwkhtmltox.so to be reachable by the system loader

-Supported settings and their meaning available at http://wkhtmltopdf.org/libwkhtmltox/pagesettings.html

HTML -> PDF example

static import pdf = wkhtmltox.pdf;

void main() {
  pdf.init();

  auto cvt = pdf.createConverter([ "out": "google.pdf" ]);
  cvt.add("https://www.google.com");
  cvt.convert();
}

HTML -> Image example

static import img = wkhtmltox.image;

void main() {
  img.init();

  auto cvt = img.createConverter("https://www.google.com", [ "out": "google.png" ]);
  cvt.convert();
}

Available versions

0.1.1 0.1.0 ~master