Page Export Formats

XWiki offers the possibility to export a single wiki page into several formats which are available by clicking on "Export" in the actions menu.

ExportMenu.png

PDF Export

To export a page as PDF, click on the PageActionsMenuButton.png button in the page's actions bar, then on "Export" and select the "Export as PDF" option under "Office Formats"

AvailableFormats.png

or type the following URL:ServerName/xwiki/bin/export/WikiSpace/WikiPage?format=pdf

Export Several Pages into the Same PDF

To export several pages into the same PDF, type the following URL: ServerName/xwiki/bin/export/WikiSpace/WikiPage?format=pdf&pages=WikiSpace.WikiPage&pages=Sandbox.ProjectTest
&pages=Managers.Leaders&pages=XWiki.MyDashboard

Note that if you are using the pages parameter to export several pages, the current wiki page specified in the URL won't be exported, so you will have to specify it again with &pages=WikiSpace.WikiPage.

URL Parameters for the PDF Export

  • pages: you can use it several times, each parameter representing a page to be exported.
  • includechilds: its numeric value specifies the depth of children pages to include in the PDF export; for instance, if you type &includechilds=2 in the URL, you will include all the children pages of the page to export (all the pages having this page as parent) and all the children's children.
  • includelinks: its numeric value specifies the depth of linked pages to include in the PDF export; for example &includelinks=2 will include all the pages linked from the page to export and the links in those pages.
  • pagebreaks: if its value is set to 1 then a page break will be inserted between all the exported pages.
  • comments: if its value is set to 1 then the comments will also be exported.
  • attachments: if its value is set to 1 then the attached images will also be exported.

The PDF Options Panel

The "PDF Export Options" panel is available when exporting a page as PDF via the "Export" menu. This panel allows you to configure the "Cover", "Table of Contents", "Comments" and "Image Attachments" parameters which were previously available only as query string parameters to the URL or by overriding the PDF templates (as described in the documentation page about the customization of the export look & feel). Moreover, you may select the page translation to export as well as disable the display of header and footer (usually the page name and date).

PDFOptionsPanel.png

ODT Export

If you configure the wiki to work with an Office server like Open Office or Libre Office, you will have a dedicated option available in the "Export" menu, under "Office Formats". By default, only the "ODT Export" will be exposed, but it is possible to export a page to other office formats supported by the Office server, like the Microsoft Word proprietary .DOC format, by typing the following URL:ServerName/xwiki/bin/export/Main/WebHome?format=doc.

RTF Export

The RTF export works just like the PDF export, the only difference being in the format you specify in the URL: ServerName/xwiki/bin/export/WikiSpace/WikiPage?format=rtf

XAR Export

This option allows you to export pages in the internal XML format used by XWiki. To do this, click on the PageActionsMenuButton.png button in the page's actions bar, then on "Export" and select the "Export as XAR" option under "Other Formats" or type the following URL: ServerName/xwiki/bin/export/WikiSpace/WikiPage?format=xar

OtherFormats.png

In case the exported page is nested and has children, you may choose to export them too.

URL Parameters for the XAR Export

  • pages: you can use it several times, each parameter representing a page to be exported.

Example:

ServerName/xwiki/bin/export/WikiSpace/WikiPage?format=xar&pages=WikiSpace.WikiPage&pages=Sandbox.ProjectTest
&pages=Managers.Leaders&pages=XWiki.MyDashboard
Note that if you are using the pages parameter to export several pages, the current wiki page specified in the URL won't be exported, so you will have to specify it again with &pages=WikiSpace.WikiPage.
  • history: if set to true (&history=true), you will also export the history of the page.
  • backup: specifies if the XWiki preserves the page author of each page when reimporting it into a XWiki instance.
  • author: if defined, specifies the author's name in the XAR export; this name can be viewed when reimporting the page into a XWiki instance.
  • description: if defined, a description will be added to the XAR export; this description can be viewed when reimporting the page into a XWiki instance.
  • license: if defined, specifies the license to the XAR export which can be viewed when reimporting the page into a XWiki instance.
  • version: if defined, specifies the version of the export.

Starting with version 6.3, the URL format has been updated in order to allow exporting:

  • a full space: /xwiki/bin/export/Main/WebHome?format=xar&name=test&pages=Main.%25 
  • a full wiki: /xwiki/bin/export/Main/WebHome?format=xar&name=test&pages=%25.%25
  • any list of pages matching a pattern: /xwiki/bin/export/Main/WebHome?format=xar&name=test&pages=%25.%25Home
Note that the character % has to be converted in %25 in an URL.

HTML Export

This option allows you to export wiki pages as static HTML pages which are independent from the XWiki engine. All pages are exported in view mode so that you won't need a web server to access them.

To export a page as HTML, click on the PageActionsMenuButton.png button in the page's actions bar, then on "Export" and select the "Export as HTML" option under "Other Formats" or type the following URL:

ServerName/xwiki/bin/export/WikiSpace/WikiPage?format=html

Similarly to the XAR export, it is now possible to export a list of selected children along with the current nested page.

URL Parameters for the HTML Export

  • name: the name of the generated .zip file.
  • description: the comment in the generated .zip file.
  • pages: you can use it several times, each parameter representing a page to be exported; for instance if you want to export all the pages from a space of a certain sub-wiki, you will type the following URL:
ServerName/xwiki/bin/export/WikiSpace/WikiPage?format=html&pages=wikiid:pageFullNamePattern
  • wikiid: the name of the wiki from where to get the wiki pages
  • pageFullNamePatern: the full name pattern of the page based on HQL "LIKE" comparator. Note that the character % has to be converted in %25 in an URL.

      

Search this space