Skip to content

maurer2/pdf-comparison

Repository files navigation

HTML to PDF comparison

Compare output of wkhtml and chrome headless by creating an intermediate png file and pixelmatching the output. [[https://github.com/maurer2/pdf-comparison/blob/master/cover.jpg|alt=cover]]

Prerequisites

WKTHMLtoPDF needs to be installed locally (https://wkhtmltopdf.org/downloads.html). WKHTMLtoPDF has a nasty bug on OSX ( wkhtmltopdf/wkhtmltopdf#3241), so you need to play around with zoom and dpi or use an older build. Imagemagick needs to be installed locally as well (https://github.com/mooz/node-pdf-image)

Installing

yarn

Running

yarn compare-pdf