Item2392: GenPDFWebkitPlugin doesn't work on Windows
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
I'm having problems generating a correct PDF (Foswiki on windows)
- wkhtml2pdf-0.8.3.exe works perfectly (I'm able to convert a existing html-file)
- opening a wikipage with "...?contenttype=application/pdf" generates an empty PDF
digging further into "lib/Foswiki/Plugins/GenPDFWebkitPlugin.pm" shows, that the tempfile with the html-output is already empty.
I added
open blabla "C:\\TEMP\\bla.html";
print blabla "$_[0]";
bla.html then contains correct output. So it seems the problem is in File::Temp. I have no idea how to debug this.
Apaches log shows
[Fri Nov 20 10:39:20 2009] [error] [client 145.228.88.119] "C:\\web\\wkhtmltopdf-0.8.3.exe" "-q" "--enable-plugins" "--outline" "--print-media-type" "C:\\temp\\o7OZXzPzqh.html" "C:\\temp\\A3dMvcxe6q.pdf" ->
--
JanDreyer - 20 Nov 2009
What's interesting: the files actally are written. I inserted the following after execution of wkhtml2pdf:
use File::Copy;
copy($htmlFile, "C:\\Temp\\bla.html") or die "File cannot be copied.";
copy($pdfFile, "C:\\Temp\\bla.pdf") or die "File cannot be copied.";
and bla.html indeed contains the correct content, though bla.pdf is a empty pdf file
Wait - that's only true if I open a separate filedescriptor instead of using File::Temp for creation of bla.html (and printing the html to this filedescriptor).
open blabla "C:\\Temp\\bla.html";
print blabla "$_[0]";
--
JanDreyer - 20 Nov 2009
Patches welcome
--
MichaelDaum - 12 Dec 2017
wkhtml is discontinued upstream.
--
MichaelDaum - 08 Nov 2024