Export Link/Button

To use the plugin, you simply need to call the page passing it a “do=export_pdf” php argument. The easiest way to implement this is to add a button or similar somewhere in your template design.

Dokubook

I use an extended dokubook for this, and have the following code inserted into the top__nav unordered list in main.php:


$pdf_plugin = &plugin_load('action','html2pdf');
if ( $pdf_plugin ) {
  if ( !plugin_isdisabled($pdf_plugin->getPluginName() ) ) {
    print '<li>'.DOKU_LF;
    print '  <a href="';
      echo exportlink($ID, 'pdf');
      print '" class="action tab_pdf" rel="nofollow">Export Pdf</a>'.DOKU_LF;
    print '</li>'.DOKU_LF;
  }
}

The appropriate bit of CSS is added for tab_pdf in dokubook_design.css.

Monobook

When using the template “monobook for DokuWiki”, and using the “default toolbox”, you simply have to add two lines in context.php (line 355) of the template:


$monobook['defaulttoolbox']['pdf']['href'] = exportlink($ID, 'pdf');
$monobook['defaulttoolbox']['pdf']['text'] = 'Export PDF';

That's all – at least for me — Werner Flamme 2009-02-16 10:00 CET

Also available in: HTML TXT