Hi, (using the cvs dev version)

I found out sth very funny. If I setup my printing pages to be sent directly to the printer - this is accomplished via the

/print.tpl.php file .

There in the opening body html tag a javascript window().print or similar is written.

Since there is no separate template for pdf printing - this causes wkhtmltopdf to die nastily trying to take this auto-print page as input....

The solution is simple - copy the print.tpl.php file to print_pdf.tpl.php and live happily.

Second solution is to try and make the .... > code conditional somehow - if it could know that it is handling a pdf page and not a printer job...

-----
This has been tested and works nice.
--------

I am also proposing we simplify the Xvfb invocation in the php code to 0 - I mean totally leave wkhtmltopdf to invoke it .

I removed all Xvfb related code and tested the printing - works nice. The idea came when I realised that wkhtmltopdf works nice from bash.

Please include the .tpl.php file as fast as you can and review my xvfb patch.

The latter possibly fixes #697616: xvfb continue to run even the process completes using wkhtmltopdf.

I don't know why the Xvfb code got in - maybe because of windows users? If so - please separate it in an if(stristr(PHP_OS, "Win")) of its own.

---
on a Debian 5 linux srv this is tested and works fine.
-----

CommentFileSizeAuthor
#1 700566.patch2.62 KBrsvelko
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rsvelko’s picture

FileSize
2.62 KB

the patch for Xvfb removal.

rsvelko’s picture

anybody comment on this?

JGO’s picture

Yes I wonder where we need xvfb for. It seems to work fine without :|

I don't see this:

/print.tpl.php file .

There in the opening body html tag a javascript window().print or similar is written.

jcnventura’s picture

Status: Active » Fixed

I've just removed the Xvfb code from the module. It was necessary upto version 0.9.0 of the wkhtmltopdf, but since it seems to be no longer needed, it is better to simply remove it.

As to the "Send to printer" and wkhtmltopdf, the solution didn't require a second PDF-specific template.

João

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.