Customizations for PDF Export Using URL Parameters

Last modified by Eleni Cojocariu on 2026/02/19 17:57

Reference

You can export a Page while viewing a Page, but you can also trigger a PDF export by changing the URL of Pages. For example, replacing "/view/" with "/export/", and adding the parameter format=pdf will export the current Page:

http://server/xwiki/bin/export/Space/Page?format=pdf

In addition, the following URL parameters can be added to customize what should be exported:

ParameterDescriptionExampleImage used for example purposes
formatYou can specify the format in which to export.http://server/xwiki/bin/export/News/Announcements?format=pdf will export the Announcements Page in PDF.hierarchy-exports.png
pagesThere can be several such parameters, each representing a Page to export. When pages parameters are specified, the current Page specified in the URL isn't used.http://server/xwiki/bin/export/News/Announcements?format=pdf&pages=News.Announcements.WebHome&pages=News.Updates.WebHome will export the Announcements and Updates Pages.
includechildsSpecifies the depth of child Pages to include in the PDF export. The value is a number indicating how many levels of child Pages to include.This URL:  http://server/xwiki/bin/export/News?format=pdf&pages=News.WebHome&includechilds=1 will export the News, Anounncements and Updates Pages, while http://server/xwiki/bin/export/News?format=pdf&pages=News.WebHome&includechilds=2 will export the News, Anounncements, Newsletter and Updates Pages.
includelinksThis parameter controls how many levels of linked Pages to include in the PDF export. The value is a number that specifies the depth of internal linked Pages to follow.This URL: 
http://server/xwiki/bin/export/News/Announcements?format=pdf&pages=News.Announcements.WebHome&includelinks=1 will include in the export the Pages Announcements and Updates (assuming it has an internal link to "Updates"), while http://server/xwiki/bin/export/News/Announcements?format=pdf&pages=News.Announcements.WebHome&includelinks=2 will include also the Newsletter Page (assuming it's also linked from the News Page).
pagebreaksIf the value is set to 1, then a Page break is inserted between all exported Pages. This means that an empty space (or a new Page) is inserted between every Page in the output, ensuring that each Page starts on a new sheet in the final document (such as a PDF).http://server/xwiki/bin/export/News/Announcements?format=pdf&pagebreaks=1
commentsIf set to 1, then also export the link to the existing comments and to the user profile of the author.http://server/xwiki/bin/export/News?format=pdf&comments=1
attachmentsIf set to 1, then also export the attachments (only if they are images). However, note that images embedded within the document (i.e., displayed directly in the Page content) are already part of the export by default. The attachments parameter specifically exports images that are uploaded to the Page but are not displayed directly within the content. These images are typically found in the attachments section of the Page.http://server/xwiki/bin/export/News?format=pdf&attachments=1

FAQ

What happens if I don't specify any parameter?

If you don't specify any parameter and just change "/view/" with "/export/": http://server/xwiki/bin/export/Space/Page the entire wiki will be exported in XAR format.

Related

Get Connected