This page is part of the guide to developing technical documentation on Confluence Wiki. Confluence itself is an excellent platform for publishing online documentation. In some cases, though, you may need to produce PDF versions of your documentation for printing, or to supply to customers who cannot access the online version.
Confluence itself provides an export to PDF. Plugins provide additional functionality.
Quick guide to PDF exports
- Customise the PDF layout (title page, header and footer) and stylesheet, for use each time you export your documentation.
- Export a single page to PDF.
- Export an entire space or a selection of pages to PDF.
- Consider installing a third-party plugin for advanced functionality.
The rest of this page gives more details of the above procedures.
Customising the PDF Layout and Stylesheet
If you are planning to provide PDF versions of your documentation, you may want to customise the PDF layout and styles for your space. These customisations will apply each time you export your documentation to PDF.
In the PDF layout, you can add your own HTML to customise the title page, page headers and page footers in the PDF output. In the PDF stylesheet, you can adjust the appearance of the PDF pages.
Editing the PDF Layout
Editing the PDF Stylesheet
Some Useful Examples
Below are the typical customisations you may want to make for your technical documentation. For more examples, see Editing the PDF Stylesheet.
Adding a Title PageYou can create a title or cover page to your PDF document using HTML. Use the 'PDF Space Export Title Page' section of the PDF layout to do this.
Adding a New Title Page
The following example uses HTML with an inline CSS rule to generate a title page.
Including Content Above Table of Contents in Default Title Page
The following example includes content above the automatically-generated table of contents that appears on the default title page, so that your title page includes your own content plus the table of contents.
Adding an Image to your Title Page
In the examples above, the title page includes an image called 'titlepage.png', centred in the middle of the page. The image is attached to a Confluence page and is referenced via its relative URL (that is, we use only the last part of the URL, excluding the Confluence site's base URL).
Follow these instructions to include an image on your title page:
- Attach the image to a Confluence page.
- View the list of attachments on that page.
- Right-click the image and copy its location.
- Paste the link into the appropriate
src=""attribute within your PDF stylesheet, as shown above.
- Remove the first part of the URL before
Adding Headers and FootersYou can add headers and footers to your PDF pages using HTML. Use the 'PDF Space Export Header' and 'PDF Space Export Footer' sections of the PDF layout to do this. For simple headers and footers, plain text is enough. The following example adds a simple copyright notice.
Adding Page Numbering to a Header or FooterTo add page numbering to your documentation, you need to combine some customised HTML in the header or footer with some customised CSS in the PDF stylesheet.
- Create a header or footer with an empty span element and give it a unique ID, for example
pageNum. This is a place holder for the page number in your PDF document.
- Create the following CSS selector rule for the empty span and add it to the PDF stylesheet:
Analysing the above CSS selector rule in more detail:
#pageNumrule selects the HTML element with the specified ID of "pageNum", which is the
spanelement we created for the header or footer.
:beforepart of the selector is a pseudo class that allows the insertion of content before the
spanelement is processed.
counter(page)is a function that returns the current page number as its content.
contentproperty tells the CSS processor that dynamic content (that is, an incrementing page number) is to be inserted before the span tag.
Exporting a Single Page to PDF
You can export a Confluence page to PDF. This option exports a single page and is available to all users who have permission to view the page:
- Go to a page in the space, open the 'Tools' menu and select 'Export to PDF'. Follow the prompts to export the page.
Exporting a Space or a Selection of Pages to PDF
Using the built-in Confluence PDF export, you can export a single page, a selection of pages or an entire space into a single PDF file.
Exporting a Spaces or Pages to PDF via a Plugin
For advanced PDF export, consider installing the Scroll Wiki Exporter plugin onto your Confluence site. Scroll provides flexible themes for configuring PDF layout and styles. You can select one of Scroll's built-in themes and configure your table of contents, header and title pages.
Advanced techniques for Scroll Wiki Exporter. For even more flexibility, you can add your own theme plugins. Scroll supports themes based on DocBook XSL stylesheets. See the Scroll developer's guide.
- Permissions required to export a space. To use the space export functionality, you need 'Export Space' permission. See the guide to space permissions or contact a space administrator for more information.
- Installing plugins. If you decide to use additional plugins, your site administrator will need to install the plugins into your Confluence site. Refer to the documentation on installing plugins.
- Plugin support. Before installing a plugin into your Confluence site, please check the plugin's information page to see whether it is supported by Atlassian, by another vendor, or not at all. See our guidelines on plugin support.
Now you know all about providing PDF versions of your documentation. What next? See other ways of Exporting and Printing Technical Documentation.