Export multi page PDF

How to generate PDF for main page along with sub pages?

Hi, it’s not possible ATM. It’s possible to manually specify a list of pages to export to PDF, see https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/Exports#HPDFExport

See Loading...

I think there are some extensions to do this but I don’t know how well they work.

We used to also have the includechild parameter (see https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/Exports#HPDFExport) but it doesn’t work for nested pages.

Thank you!!

Hello @vinobalakrish !

this is not a standard feature of the product, but there is a trick that can be used that is, in a good amount of cases, fulfilling the need.
XWiki provides one very useful macro : the display macro (with its ancestor the include macro) : https://extensions.xwiki.org/xwiki/bin/view/Extension/Display%20Macro . This macro allows to display the content of a page in another page. A particular usecase is when a user would construct a document that has no own content, but only displays other documents. Then, this constructed document will behave like any other document in the wiki, and this includes being able to export as PDF (or other formats).
The display macro is fully dynamical, meaning that when a displayed document is updated, the constructed document will also display on screen the updated content, so you don’t need to worry about updating the “constructed” document manually any time you make changes to a document that composes it.

This “trick” can be used to assemble larger PDF files from multiple wiki documents.
Also, with just a little bit of velocity scripting (if you have some development skills or a developer that can help), it’s possible to automatize this and have such a constructed document include all its children so that you don’t need to worry anymore about updating the constructed document when a new child page is added.
Also, as a feature, note that if you construct the result yourself with the display macro you can fully control the order in which the documents are included in the resulted PDF instead of having an “automatic” order, in case you need to control that.

Enjoy knowledge sharing,
Anca

1 Like

Thanks @lucaa. I’ve found your answer useful and I’ve taken the liberty to move it to https://www.xwiki.org/xwiki/bin/view/FAQ/How%20to%20export%20multiple%20pages%20to%20PDF

Feel free to edit it ofc.

Unfortunately the display macro is not compatible with 13.3 according the extension manager. So cannot be installed using the extension manager.

The display macro is installed by default normally, so you should have it already.