splitbrain / dokuwiki-plugin-dw2pdf

A fork of Luigi Micco's PDF export plugin for DokuWiki
http://www.dokuwiki.org/plugin:dw2pdf
55 stars 68 forks source link

Not including dynamically generated content (using pagetemplater) #374

Closed juliusverrel closed 1 year ago

juliusverrel commented 5 years ago

For pages dynamically created using a template (pagetemplater), the PDF contains only contains the content of the current page, not the additional content defined by the template.

Can this be solved in dw2pdf or does it require changes in pagetemplater?

Klap-in commented 5 years ago

The dw2pdf plugin includes everything rendered by the xhtml render, and creates from the html a pdf. If the default rendered html is too complicated, you can conditionally output something more simple for the dw2pdf plugin. See https://www.dokuwiki.org/plugin:dw2pdf:exportsupport

So on first guess I would think it could work, but maybe some caching or other special stuff messes the process..

Klap-in commented 5 years ago

The pagetemplater plugin puts just placeholders in the text when parsing a page. And next if the page is displayed with tpl_content() function, the event TPL_CONTENT_DISPLAY is triggered. By this event trigger, this plugin performs the placeholder replacements.

The dw2pdf plugin uses p_render(), which doesn't trigger this event. So the placeholders aren't replaced. I am not sure why @gamma needs to perform the replacements via this trigger. As long as that the replacements are done in the content show step, the pagetemplater can not be utilized in combination with the dw2pdf plugin.

juliusverrel commented 5 years ago

Thanks for the explanation. Would it make more sense to trigger the pagetemplater action (replacing placeholders) by RENDERER_CONTENT_POSTPROCESS (triggered by p_render)?

Klap-in commented 1 year ago

I have not checked if you proposal can solve the issue. It is an issue that should be solved by that plugin, so I'm closing the issue here.