ChromiumPdfGeneratorScript

class ChromiumPdfGeneratorScript(sourcesDirectory: File, out: File, browser: ChromiumWrapper, noSandbox: Boolean = false)

Script-like generator of a PDF from HTML through a Chromium-family browser, driven over the Chrome DevTools Protocol via ChromiumInteraction.

Parameters

sourcesDirectory

directory containing the index.html file

out

output PDF file to be written

browser

browser executable wrapper

noSandbox

whether to disable the Chromium sandbox for PDF export

Constructors

Link copied to clipboard
constructor(sourcesDirectory: File, out: File, browser: ChromiumWrapper, noSandbox: Boolean = false)

Functions

Link copied to clipboard
fun launch()

Launches the browser to convert the webpage from sourcesDirectory into a PDF saved at out. Blocking call.