Skip to content

Commit 3ab6a5f

Browse files
committed
Fix dw2pdf multipage struct output
When the dw2pdf plugin is used to export multiple pages in a single document, all the pages are rendered in the same context of a single page. In order to include struct data in the PDF, let's skip the id related checks and allow multiple pages rendered in a single instance of syntax_plugin_struct_output. Signed-off-by: Frieder Schrempf <[email protected]>
1 parent d9b413c commit 3ab6a5f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

syntax/output.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,20 @@ public function render($format, Doku_Renderer $renderer, $data)
9898
return true;
9999
}
100100
}
101-
if ($ID != $INFO['id']) return true;
102-
if (!$INFO['exists']) return true;
103-
if ($this->hasBeenRendered) return true;
101+
102+
/*
103+
* When the dw2pdf plugin is used to export multiple pages in a
104+
* single document, all the pages are rendered in the same context
105+
* of a single page. In order to include struct data in the PDF,
106+
* let's skip the id related checks and allow multiple pages rendered
107+
* in a single instance of syntax_plugin_struct_output.
108+
*/
109+
if (!is_a($renderer, 'renderer_plugin_dw2pdf')) {
110+
if ($ID != $INFO['id']) return true;
111+
if (!$INFO['exists']) return true;
112+
if ($this->hasBeenRendered) return true;
113+
}
114+
104115
if (!preg_match(self::WHITELIST_ACTIONS, act_clean($ACT))) return true;
105116

106117
// do not render the output twice on the same page, e.g. when another page has been included

0 commit comments

Comments
 (0)