Providing PDF Versions of your Technical Documentation

This page is part of the guide on Developing Technical Documentation on Confluence Wiki.

Confluence is a platform for publishing online documentation. It also provides functionality for producing PDF versions of your documentation, allowing you to print the documentation, or to provide a copy to customers who are unable to access the online version. This guide describes how to export your technical documentation to PDF using Confluence's built-in PDF export. We also introduce a third-party add-on that provides additional PDF layout and style functionality.

Quick guide to PDF exports:

  • Customise the PDF layout (title page, header and footer) and style, for use each time you export your documentation.
  • Export a single page to PDF.
  • Export a selection of pages or an entire space to PDF.
  • Consider installing a third-party add-on for advanced PDF export functionality.

The rest of this page gives more details of the above procedures.

On this page:

Customising the PDF layout and style

If you plan to create PDF versions of your documentation, you may want to customise the PDF layout and styles for your space. These customisations will be applied every time you export documentation to PDF.

Under PDF layout you can add HTML to customise the PDF title page, and the page headers and footers. Under PDF stylesheet, you can adjust the appearance of the PDF pages.

Editing the PDF layout

Setting a global PDF layout

  1. Choose the cog icon , then choose General Configuration under Confluence Administration.
  2. Choose PDF Layout. You can enter HTML and CSS that will be rendered on the PDF title page, as well as page headers and footers.

Setting the PDF layout at space level

  1. Go to the space and choose Space tools > Look and Feel on the sidebar. You'll need Space Admin permissions to do this. 
  2. Choose PDF Layout.
  3. Choose Edit.

If your space uses the Documentation theme:

  1. Choose Browse > Space Admin at the top of the screen.Note: The 'Space Admin' option appears only if you have space admin permissions for the space or you have System Administrator global permissions.
  2. Choose PDF Layout in space administration options.
  3. Choose Edit.

You can customise the HTML that is generated for the following areas when the space is exported to PDF:

  • PDF Space Export Title Page – title page.
  • PDF Space Export Header – page headers.
  • PDF Space Export Footer – page footers.

Enter your customisations into each text box as required. The PDF layout section accepts HTML code. You can include inline CSS in the HTML too.

Editing the PDF stylesheet

Setting a global PDF Stylesheet

  1. Choose the cog icon , then choose General Configuration under Confluence Administration.
  2. Choose Look and Feel > PDF Stylesheet. The following screen allows you to enter and save CSS code that will render content on each page.

Setting a space PDF stylesheet

  1. Go to the space and choose Space tools > Look and Feel on the sidebar. You'll need Space Admin permissions to do this. 
  2. Choose PDF Stylesheet.
  3. Choose Edit.
  4. Enter your customisations.

If your space uses the Documentation theme:

  1. Choose Browse > Space Admin at the top of the screen.Note: The 'Space Admin' option appears only if you have space admin permissions for the space or you have System Administrator global permissions.
  2. Choose PDF Stylesheet in the space administration options. 
  3. Choose Edit
  4. Enter your customisations.

The The 'PDF Export Stylesheet' page shows the current (e.g. customised) contents of your PDF stylesheet. 

Examples of PDF customisation

Below are typical customisations you may want to make for your technical documentation. For more examples, see Customising Exports to PDF.

Adding a title page

You 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.

<div class="fsTitlePage" style="margin-left:auto;margin-top:75mm;margin-right:auto;page-break-after:always">
<img src="/download/attachments/12345/titlepage.png"/>
</div>
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.

<div class="fsTitlePage" style="margin-left:auto;margin-top:75mm;margin-right:auto;">
<img src="/download/attachments/12345/titlepage.png"/>
</div>
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:

  1. Attach the image to a Confluence page.
  2. View the list of attachments on that page.
  3. Right-click the image and copy its location.
  4. Paste the link into the appropriate src="" attribute within your PDF stylesheet, as shown above.
  5. Remove the first part of the URL before /download/....

Adding headers and footers

You 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.

Copyright © 2010, Atlassian Pty Ltd.

Adding page numbers to a header or footer

To add page numbering, you need to combine customised HTML in the PDF Layout with customised CSS in the PDF Stylesheet.
  1. PDF Layout HTML: In the Footer section (or the Header section), use an empty span element with a unique ID, for example pageNum, to act as a place holder for the page number.

    HTML - PDF Layout: Footer Section
    <span id="pageNum"/>
    
  2. PDF Stylesheet CSS: Create the following CSS selector rule for the empty span:

    CSS - PDF Stylesheet
    #pageNum:before
    {
    content: counter(page);
    }
    

Analysing the above CSS selector rule in more detail:

  • The #pageNum rule selects the HTML element with the specified ID of "pageNum", which is the span element we created for the header or footer.
  • The :before part of the selector is a pseudo class that allows the insertion of content before the span element is processed.
  • The counter(page) is a function that returns the current page number as its content.
  • The content property tells the CSS processor that dynamic content (that is, an incrementing page number) is to be inserted at the span tag.

Exporting to PDF

You can use the built-in Confluence PDF export to export a single page, a selection of pages or an entire space to a single PDF file.

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 and choose Tools > Export to PDF. Follow the prompts to export the page.

Exporting a selection of pages or a space to PDF

  1. Go to the space and choose Space tools > Content Tools on the sidebar. 
  2. Choose Export. This option will only be visible if you have the 'Export Space' permission.
  3. Select PDF then choose Next
  4. Decide whether you need to customise the export:
    • Select Normal Export to produce a PDF file containing all the pages that you have permission to view.
    • Select Custom Export if you want to export a subset of pages.
  5. Select the pages you want to export.
    • You have the option to Select All or Deselect All pages.
    • When you select a page, all its child pages will also be selected. Similarly, when you deselect a page all its child pages will also be deselected.
  6. Choose Export.
  7. When the export process has finished, download and save the PDF file as prompted.

If your space uses the Documentation theme:

  1. Choose Browse > Space Operations
  2. Choose PDF Export from the left menu.
  3.  Follow the steps above to export the Space.


Using the Scroll PDF Exporter add-on (Not applicable to Confluence Cloud.)

The Scroll PDF Exporter provides flexible themes for configuring PDF layout and styles. You can select one of Scroll PDF Exporter's built-in themes and configure your table of contents, header and title pages. For even more flexibility, see the section How Tos in the Scroll PDF Exporter documentation.

For this advanced PDF export functionality, you will need to install the Scroll PDF Exporter add-on into your Confluence site. 

Notes

  • Permissions required to export a space: 
    To use the space export functionality, you need the 'Export Space' permission. See the guide to space permissions.
  • Installing add-ons: If you decide to use additional add-ons, your site administrator will need to install the add-ons into your Confluence site. Refer to the documentation on installing add-ons. (Not applicable to Confluence Cloud.)
  • Add-on support: Before installing an add-on (also called a plugin) into your Confluence site, please check the add-on's information page to see whether it is supported by Atlassian, by another vendor, or not at all. See our guidelines on add-on support.
Next Steps

Now you know all about providing PDF versions of your documentation. What next? See other ways of Exporting and Printing Technical Documentation.

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport