You are here: Foswiki>Tasks Web>Item1174 (09 Mar 2010, GeorgeClark)Edit Attach

Item1174: Convert GenPDFAddOn to Plugin and add macro support.

Priority: Enhancement
Current State: Closed
Released In:
Target Release: n/a
Applies To: Extension
Component: GenPDFAddOn
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
Track changes to convert GenPDFAddOn to a Plugin. The primary reason is to add a %GENPDF% to simplify generation of PDF output from a topic.

I need some help defining the features for the GENPDF macro. Here is what I have so far:

  • GENPDF{} Creat a link to generate a PDF of the current topic. Link will appear as http://...

  • GENPDF{"Web.Topic"} Create a link for the named topic. Link will appear as http://...

Other optional parameters

  • link="text" Link will use specified link text instead of showing the actual link.
  • copyquery Copy the current page querystring into the link. Used to correctly render topics that use urlparams
  • pdfxxxx Specify any of the supported pdfxxxx parameters of genpdf
  • img Specify an image to use as the link instead of text. Can be combined with the link= parameter

Also I'd like to include css or style options so that the PDF icon can appear in the upper-right corner of the document, or as desired

Any other suggestions on parameters or implementation would be helpful.

  • auto-detect lack of heading tags and force webpage mode to avoid empty PDF files.
  • Make sure final results show up with installed and new version in the "Find Foswiki Extensions" page
  • Tolerate missing PDFSTOP tag
  • Eliminate call to Foswiki::initialize - Deprecated, and removed from trunk for next major release

-- GeorgeClark - 14 Mar 2009

Here are few things from my wish list:
  • GENPDF{"Web.Topic.Section"} Create a link for the named section of a topic. Link will appear as http://...
  • On the old 'dev' topic someone requested that links show in blue, otherwise they're impossible to see against the rest of the black text. I hard-coded that on my site (push @htmldocArgs, "--linkcolor", "#0000FF"; # Otherwise they are black). Some may not want that, so the ideal solution would be to make it configurable.
  • Before going crazy with a bunch of macro tags, maybe it would be better to include something like my form to configure the options without having to mess with the URL or a bunch of macro tags? Perhaps it would be better implemented as a pop-up (analagous to the print options dialog in Windows) so as not to force a navigation away from the source document.
  • Provide an option to create stand-Alone Documents (i.e., not link back to Wiki). Could do this with custom skin? Or by modifying "sub _fixHtml()" in
    • Convert all internal links to be relative links (e.g., <a href="#name">). These are used in the ToC, but can be in the body too.
    • Remove remaining links to Wiki host, while leaving external links. E.g., this removes table header sort links (which are non-functioning in a PDF anyway, and hard to see against a dark column header).

-- SeanMorgan - 20 Mar 2009

Changing this bug report back to "new" for now.

Scaling this back a bit but will release a helper plugin as part of GenPDFAddOn. GenPDFAddOn will still have original functionality with this plugin disabled. Will leave this in process. The initial release will only implement the basic %GENPDF% tag.
Topic revision: r11 - 09 Mar 2010, GeorgeClark - This page was cached on 18 Sep 2021 - 06:34.

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