cloudify / sPDF

Create PDFs from Scala using plain old HTML and CSS. Uses wkhtmltopdf on the back-end which renders HTML using Webkit.
Other
199 stars 53 forks source link

PDF generation fails silently #23

Open pathikrit opened 9 years ago

pathikrit commented 9 years ago

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?

guillaumebadin commented 8 years ago

+1