|
This recipe addresses sites using the cookbook add-on PmWiki Draw to draw and edit images using the (:drawing imagename:) markup. Generating pages with Wikipublisher ignores all images written as editable drawings. The problem is that (:drawing imagename:) produces HTML, so the PDF generator does not understand it. The solution is to create a markup rule that is evaluated before the (:drawing:) directive to turn the reference to imagename into a “normal” PmWiki image reference, when we want a PDF. PmWiki Draw images appear to go into the uploads directory, as .gif files, so we have to change (:drawing imagename:) into Attach:imagename.gif and let the Wikipublisher engine process it as a regular attached image. To do this, add the following rule to local/config.php, after loading the wikipublisher extensions:
if ($format=='pdf')
Markup('pdfdrawing', '<drawing',
'/\(:drawing\s+(.*?)\s*:\)/',
'Attach:$1.gif');
This tells Wikipublisher to treat imagename like an attached image. Contributors: John Rankin and Miklos?, Friday, 18 April 2008. « One Click PDF | Cookbook | Quoting People » |