Skip to content

PDF generation fails silently #23

@pathikrit

Description

@pathikrit

This library works on my mac just fine.

But, on, ubuntu 14.04, I have it installed like this:

$ which wkhtmltopdf
/usr/bin/wkhtmltopdf

$wkhtmltopdf -V
Name:
  wkhtmltopdf 0.9.9
...

I am using it like this:

val html: String = "<html> .... "
val pdf = Pdf("/usr/bin/wkhtmltopdf", PdfConfig.default)
val destination = File.createTempFile("html2pdf", ".pdf")
val exitCode = pdf.run(html, destination)
if (exitCode != 0) Logger.error(s"PDF generation task exited with non-zero exitCode=$exitCode")
if (destination.length() == 0) Logger.warn(s"Generated PDF is empty")

But, I see that exitCode is 1 and the generated PDF is empty.
What's wrong? Why is it silently failing? It does not print any other helpful debug info at all! How can I make it print debug info and underlying error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions