You need to have chromedriver installed, click here
to download the latest version.
Hepek uses it to properly wait for JS to be loaded, then it takes a snapshot of your HTML,
and renders it to PDF with openhtmltopdf.
Rendering your PDF is just a matter of calling PdfGenerator.generate(file, targetFolder, pages)
.
Hepek must know about the chromedriver via webdriver.chrome.driver
system variable.
Example app:
object PdfGenApp {
def main(args: Array[String]): Unit = {
System.setProperty("webdriver.chrome.driver", "C:/selenium/chromedriver.exe")
val targetFolder = "C:/my-site/target/web/public/main"
val file = new File(s"pdfs/MyStuff.pdf")
PdfGenerator.generate(file, targetFolder, pages)
}
}
And then just run it!