You are here: Foswiki>Tasks Web>Item2392 (12 Dec 2017, MichaelDaum)Edit Attach

Item2392: GenPDFWebkitPlugin doesn't work on Windows

pencil
Priority: Normal
Current State: Needs Developer
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: GenPDFWebkitPlugin
Branches:
Reported By: JanDreyer
Waiting For:
Last Change By: MichaelDaum
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 frown, sad smile

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
 

ItemTemplate edit

Summary GenPDFWebkitPlugin doesn't work on Windows
ReportedBy JanDreyer
Codebase 1.0.0
SVN Range Foswiki-1.0.7, Sun, 20 Sep 2009, build 5061
AppliesTo Extension
Component GenPDFWebkitPlugin
Priority Normal
CurrentState Needs Developer
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r3 - 12 Dec 2017, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy