I use the wkhtmltopdf library with tokens in the header text.

If a value is not available, the token is not replaced.

I solved this problem by changing line 30 of lib_handlers\print_pdf_wkhtmltopdf\print_pdf_wkhtmltopdf.pages.inc. by adding the option array('clear'=>true). See http://api.drupal.org/api/drupal/includes!token.inc/function/token_repla... for documentation.

    $wkhtmltopdf_options = token_replace($wkhtmltopdf_options, array('node' => $meta['node']), array('clear'=>true));

Comments

jcnventura’s picture

Status: Active » Needs review
jcnventura’s picture

Status: Needs review » Fixed

Thanks for the suggestion.. There were a few more places where that clear flag was useful.

http://drupalcode.org/project/print.git/commit/eaa3d3d

Status: Fixed » Closed (fixed)

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