How to create your own PDF Template

export pdf xwiki

As you made it this far ...

Stay up to date with our monthly newsletter and get more articles, tips and tricks like these straight to your inbox.

By filling in your data, subscribing to the newsletter and by clicking "Subscribe" you agree to our Privacy Policy .

All set! You'll receive our newsletter at the end of each month.

Please visit our subscription center to select the types of updates youd like to receive from us (tips and tricks, product and service updates etc).

export pdf xwiki

Article updated on 20th December 2023 with information about the client-side PDF Export app  (bundled by default in XWiki since 14.10). If you are using a newer version of XWiki, starting 14.10, and you're interested in creating a custom PDF Template with the client-side PDF Export app, check out the instructions on the documentation page .

The subject of this article remains the creation of a PDF Template while using the old PDF Export (present on versions before XWiki 14.10), with an example done on XWiki Jetty 13.4.5.

Have you considered to personalize the look of your PDF exported wiki pages? Let's say you'd like to export a purchase order that you created for your client who just bought your services. Or, you'd need to export a monthly report for the management team wanting to explore financial evolution measurements, which would help skyrocket your sales. Your original page contains a table, a diagram, a chart, and an infobox where you highlight services details. Apart from this, you'd like to make your exported PDF even more professional, so you'd like to add to it cover page, a table of content and a footer section with your company details. This is all possible with XWiki with a little bit of help from a more tech-savy colleague.

What do you need for your PDF export?

How to add the pdfclass page, do i need to add anything special in my wiki page, how to add the pdf template page, how to use the new pdf template, advanced documentation and examples, here is the exported pdf of my report.

You'll need 3 main ingredients: a PDFClass page, a wiki page to be exported as a PDF, and a PDF Template page.

I created an example of a page for this article, named  My Report . You will see how to personalize the look of headings, message macros (info, box, warning, error, success, code), of a diagram, an image in a gallery macro, a chart and of tables in a PDF exported from your wiki.


Firstly, make sure you are an advanced user in the wiki, by going to your user profile, the preferences section and selecting the Advanced type of user. After that, you will be able to edit pages in object mode or to create terminal pages. Create a new  terminal page  which you would need to name "PDFClass", with "XWiki" as parent of the page. This will represent the object containing the customization properties that will then be added to your PDF template. After you create and save this new page, edit the page in "Class" mode (e.g.  https://yourserver/xwiki/bin/edit/XWiki/PDFClass?editor=class ) and add the following TextArea properties: 

  • style : contains the CSS rules used to render the content as PDF. 
  • cover : if you want to modify the cover of your PDF export.
  • header : if you'd like to add a specific text or image on the header of each page of your PDF export.
  • footer : if you need a specific content on your page footer, such as contact details of your company.
  • (optional) xhtmlxsl : contains the XHTML2FO XSL transformation into HTML, text, or other XML document types, which will override the default one. Note that you can also use velocity in this field (useful to get the content of an attached .xsl file, which comes in very handy when you need to fill in a big file, since the limit of textarea properties is of 60 000 characters).
  • (optional) fopxsl : contains the FOP XSL transformation that will override the default one.

Note that the css that would be added in the style property will override the default pdf.css values. However, by default, there won't be a pdf.css file on your filesystem, but you can create it in the folder \webapps\xwiki\templates\ or add it in your skin page from the administration of your wiki, the Look and Feel section, the Themes tab.

Also the xhtmlxsl and the fopxsl properties are not mandatory, as these would be needed only if you would want to override existing values.

While editing the PDFClass page in class mode, make sure that you set the suitable Content and Editor types for the properties that you add. For my example, I used:

  • for the  style  I used the  PlainText  option for both  Editor  and  Content Type  metadata.
  • for the  cover ,  header  and  footer  I picked the option  Wiki Syntax  in the  Content Type  metadata, and  PlainText  for the  Editor  metadata


The answer is yes , but no need to panic. It would simply be a need to add some classes to elements of your page in order to easily target them in the style added in the PDF Template page.

For example, for a table, I added in source editor mode (% class="mytable" %) above the desired table. I added classes to the heading sections as well, because I want to add style on them as well. Then, on the macros, on some of them (like the info, warning, gallery macros) you can add a cssClass directly when adding them on the page or later on, when editing the macros or also in source editor mode.

On the images from the gallery below you can see the page that will be exported as a PDF edited in Source mode and the classes of the sections that will get targeted by the CSS added in the style object of the Report PDF Template.


Create a new terminal page (for example "Report PDF Template") with XWiki as its parent, save it and then edit it in "Object" mode (e.g.  https://yourserver /xwiki /bin/edit/XWiki/reportPDFtemplate?editor=object ). Add the newly created PDFClass object to it. In the "style" property section you will be able to add the desired styling targeting your pages that you want to export as a PDF file. I then started to fill in the style property with CSS code. I placed in this snippet the complete CSS used for the PDF export from this article.

These code lines were then placed in the following cover, header and footer property:

  • in the cover property, I added an image that was attached to the Report PDF Template page and I set a title
  • in the header property, I added a smaller image that was attached to the Report PDF Template page and the same title as on the cover
  • in the footer property, I added the page number, an email address for contact, a website and a line describing on which type of XWiki instance the example was done


There is already a possibility to export your XWiki pages as PDFs. Let's consider my example of a wiki page named My Report . I click on the Export option, select the PDF one, pick the sections that I want to export along with the page (e.g. cover, table of contents, header, footer), and then I click on the Export button. You would obtain a regular look, without no personalization. Here is how to get the styling added in the ReportPDFTemplate page:

  • One would be to add in the URL of the exported file the name of the PDF template with the space name that locates the file. When exporting without the cover, table of contents, header and footer the URL would look like: https://yourserver/xwiki/bin/export/myreport/WebHome?pdftemplate= XWiki.reportPDFtemplate &format=pdf  and with the table of contents, cover, header and footer selected for export the URL would look like: https://yourserver/xwiki/bin/export/myreport/WebHome?pdftemplate=XWiki.reportPDFtemplate&format=pdf&pdfcover=1&pdfcover=0&pdftoc=1&pdftoc=0&pdfheader=1&pdfheader=0&pdffooter=1&pdffooter=0
  • A second option would be to use an extension that was build for the purpose to pick from multiple PDF templates when exporting a page . However, please note that the extension has not been maintained throughout the years.

Here is the documentation page describing how to customize the look and feel of your exported PDF (referring to the old PDF Export present on XWiki versions before 14.10) with an advanced look on each component and how they work. You'll notice there more advanced methods to customize your exported PDF: modifying the skin of your wiki or overriding the xhtml2fo.xsl file with specific rules to your desired to-be-exported page. 

Check out the snippets containing two examples of styling:

  • Add table borders to your PDF
  • Add a complete look for your customized PDF template  (the CSS style used for the PDF export of  My Report  from this article)

What would you like to add in your customized PDF export? Let us know in the comments below or on social media. We can gladly share with you how you could contribute with more styling scenarios or guide you to get the right services, depending on your needs.

Check out the PDF Viewer Macro which allows users to load and view PDF files inside a wiki page. The Viewer supports a double full screen mode: first going full screen in your browser and then going full screen on your computer if your browser supports that mode. The PDF location could be the current wiki page, another wiki page or an external URL.

Don't forget to share this post!


You may also be interested in:

Pro apps status for 2023 🔭, is xwiki free a comprehensive guide, webinar overview: introducing confluence migrator (pro) - multi space import and other improvements.

  • Comments (2)
  • XWiki Standard
  • Business Apps & Connectors
  • XWiki Procedures
  • Standard Services
  • Knowledge Base
  • Procedures Management
  • Extranet and Communities
  • Digital Workplace
  • Custom Apps
  • Custom Services
  • Our Methodology
  • XWiki Store
  • Compare XWiki Versions
  • Compare XWiki with Other Products
  • Help Center
  • XWiki Network
  • Libre & Open Source
  • References & Partners
  • Subscription center

XWiki Forum

Watermark in exported pdf file

I need to show watermark on each page of exported file. Pls tell how can I…


One of the simple and free solution to Add Watermark in PDF Software apply watermark to multiple PDF A few days back one of my friend was also facing the same issue and I suggested him to use this professional solution to insert watermark in PDF files. Must say this tool easily add image or text watermark on multiple PDF documents. VISIT

XWiki Platform PDF Export UI Korean

  • Download translation

Customize download

  • Data exports
  • Failing checks
  • Share on Facebook
  • Engage page
  • Status widgets

Translation status

Strings status, other components, string statistics, activity in last 12 months, quick numbers, trends of last 30 days, quick downloads.

  • Untranslated strings • state:empty
  • Unfinished strings • state:<translated
  • Translated strings • state:>=translated
  • Strings marked for edit • state:needs-editing
  • Strings with suggestions • has:suggestion
  • Strings with variants • has:variant
  • Strings with screenshots • has:screenshot
  • Strings with labels • has:label
  • Strings with context • has:context
  • Unfinished strings without suggestions • state:<translated AND NOT has:suggestion
  • Strings with comments • has:comment
  • Strings with any failing checks • has:check
  • Approved strings • state:approved
  • Strings waiting for review • state:translated
  • Position and priority
  • Source string
  • Target string
  • Last updated
  • Number of words
  • Number of comments
  • Number of failing checks
  • String location
  • Source strings
  • Target strings
  • Key/Context strings
  • Source string description
  • Location strings
  • String state
  • Pending string
  • String target language
  • String changed by
  • Strings with suggestions
  • Strings with comments
  • Strings with any failing checks
  • Strings without screenshots
  • Pluralized string
  • Strings with context
  • =">String changed after
  • String changed before


  1. PDF Export Application (

    export pdf xwiki

  2. L'export PDF dans XWiki

    export pdf xwiki

  3. How to create your own PDF Template

    export pdf xwiki

  4. Importez et exportez du contenu vers et depuis XWiki

    export pdf xwiki

  5. xwiki管理指南-配置-CSDN博客

    export pdf xwiki

  6. Confluence to XWiki migration guide: from export to customization

    export pdf xwiki


  1. Import, Edit and Export PDF Files on #Canva

  2. How to Export Sales Invoice in PDF formate?

  3. Export pdf

  4. xWiki on Azure VM tech tutorial

  5. How to sell Invoice PDF Export In Busy Software # Sale Bill को PDF में कैसे Export करे Sonu Mehla

  6. How to Export as PDF


  1. Exports (

    Advanced A PDF export can also be triggered by using the following type of URLs: http://server/xwiki/bin/export/Space/Page?format=pdf The old PDF export (unlike the new one) doesn't provide an UI for multipage export. However it's possible to export a set of pages, using the following type of URL:

  2. Easily import and export content to and from XWiki

    If you'd like to export a single page as a XAR, you need to go to that particular page and click "Export" from the "More actions" menu. For pages, you also have the ability to do exports to PDF, ODT, RTF and HTML formats. Import content There are several types of imports that can be done inside XWiki: Importing XWiki pages (XAR format)

  3. Client-side PDF Export (Proposal.PDFExport)

    PDF Export Application Description The goal of this design page is to list the requirements of the PDF export feature and to document possible implementation solutions. Requirements Implementation Alternatives From HTML+CSS to XSL-FO and PDF From HTML+CSS directly to PDF Using Browser Print Proposed Implementation Requirements

  4. How to create your own PDF Template

    You'll need 3 main ingredients: a PDFClass page, a wiki page to be exported as a PDF, and a PDF Template page. I created an example of a page for this article, named My Report.

  5. Export Formats (

    hint: description of the export format, hidden by default, but used when filtering the export formats; icon: the icon to display on the Export Modal, e.g. "file-pdf"; see the Icon Theme Application for more information; category: the export format category, used for grouping export formats on the Export Modal, e.g. "office"; defaults to "other"

  6. Customizing the PDF export Look & Feel

    You'll need 3 main items: a wiki page to be exported as a PDF (you might have that covered already ), a PDFClass page and a PDF Template page. Check out the stages presented below to learn how you could get from the standard PDF export [adding screenshot here] to a customized result. [adding screenshot here] Adding classes in the wiki page

  7. How to export multiple pages to PDF?

    This macro allows to display the content of a page in another page. A particular use case 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 ...

  8. Export multi page PDF

    Export multi page PDF vinobalakrish June 4, 2020, 6:49am #1 How to generate PDF for main page along with sub pages? vmassol June 4, 2020, 6:55am #2 Hi, it's not possible ATM. It's possible to manually specify a list of pages to export to PDF, see

  9. Implement PDF export with XHTML and paged CSS

    Currently, the PDF export of XWiki is implemented based on XSL-FO and transformation of XHTML to FO. This poses a couple of problems, mainly related to the current level of support of FO from libraries implementing FO to PDF transformation, as well as the limitations of automatized transformation of XHTML to FO. ...

  10. PDF Export Application Improvements (

    XWiki. Release Notes for XWiki 14.8. PDF Export Application Improvements ...

  11. XWiki Platform Export PDF Default » 16.0.0-rc-1

    XWiki Platform Export PDF Default » 16.0.0-rc-1. Default implementation of the API for multipage PDF export using a headless Chrome browser running inside a Docker container. License: LGPL 2.1: Tags: pdf export xwiki platform: Date: Jan 23, 2024: Files: pom (5 KB) jar (70 KB) View All: Repositories:

  12. PDF Export Administration (

    selecting and configuring the tool used to generated the PDF; showing the state of the PDF generator; and since 14.9 final, setting the page ready timeout, that is the number of seconds to wait for the web page to be ready for print before aborting the PDF export; Checkout the documentation for more information.

  13. Pdf export issue

    Pdf export issue Help / Discuss Elric December 20, 2017, 11:26am #1 Hello, When I want to export a page in pdf, I experiencing Java exception. It may be an issue related to permissions, but I don't now what exactly. If you can help me to fix this issue, I will be very happy. beginning of exception ;

  14. Watermark in exported pdf file

    One of the simple and free solution to Add Watermark in PDF Software apply watermark to multiple PDF A few days back one of my friend was also facing the same issue and I suggested him to use this professional solution to insert watermark in PDF files. Must say this tool easily add image or text watermark on multiple PDF documents.

  15. Browser-based PDF Export Used by Default (

    Release Notes for XWiki 14.10. Browser-based PDF Export Used by Default

  16. Getting Started (

    Welcome to the XWiki "Get Started" page. This guide provides basic information on how to set up and use XWiki. Start by learning more about wikis.. XWiki's use cases are diverse: collaborative intranet, knowledge base, CMS, competitive intelligence, public debate, collaborative creation of school courses, web site creation, etc. Read more on what wikis can be used for, what makes XWiki special ...

  17. Exports (

    Toggle navigation; Search. Log-in Register

  18. XWiki Platform/PDF Export UI

    XWiki Platform is being translated into 41 languages using Weblate. Join the translation or start translating your own project.