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.

On this page:

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

グローバル PDF レイアウトを設定する

  1. Open the Confluence Admin screen.
  2. Select Look and Feel > PDF Layout. The following screens allows you to enter HTML and CSS that will be rendered on the PDF title page, as well as page headers and footers.

スペースレベルで PDF レイアウトを設定する

  1. Choose Browse > Space Admin.
    (info) Space Admin is displayed only if you are a space administrator for that space or you are a Confluence system administrator.

  2. Click PDF Layout in the 'Look and Feel' section of the left-hand panel.
  3. Click Edit, and customise the HTML that generates the following areas in the exported PDF document:
    • PDF Space Export Title Page – title page.
    • PDF Space Export Header – page headers.
    • PDF Space Export Footer – page footers.
  4. 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. Save your work.

Editing the PDF Stylesheet

グローバル PDF スタイルシートを設定する

  1. Open the Confluence Admin screen.
  2. Click 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-level PDF stylesheet

  1. Choose Browse > Space Admin.
    (info) Space Admin is displayed only if you are a space administrator for that space or you are a Confluence system administrator.

  2. Click PDF Stylesheet in the left-hand panel. The 'PDF Export Stylesheet' section appears, showing the current contents of your PDF stylesheet. It contains all CSS rule customisations applied to the pages in the space.
  3. Click Edit and enter your customisations into the text box as required. The PDF stylesheet section accepts Cascading Style Sheets (CSS) rules. Save your work.

Some Useful Examples

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

Adding a Title Page

HTML を使用して、PDF 文書のタイトルまたは表紙ページを作成できます。PDF レイアウトの PDF スペース エクスポート タイトルページ セクションを使用します。
新しいタイトル ページの追加

以下の例は、インライン CSS ルールを含む HTML を使用してタイトル ページを生成する手順を示しています。

<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>
デフォルト タイトル ページの目次の上へのコンテンツの追加

以下の例は、タイトル ページに目次に加えて独自のコンテンツを含めるため、デフォルト タイトル ページに表示されるコンテンツの自動生成テーブルの上にコンテンツを追加する手順を示しています。

<div class="fsTitlePage" style="margin-left:auto;margin-top:75mm;margin-right:auto;">
<img src="/download/attachments/12345/titlepage.png"/>
</div>
タイトル ページへの画像の追加

上記の例では、タイトル ページの中央に「titlepage.png」という画像を追加しています。この画像は Confluence ページに添付された、対応する URL (Confluence サイトのベース URL を除く URL の最後の部分のみ使用します) を介して参照されます。

次の手順にしたがって、タイトル ページに画像を含めます。

  1. 画像を Confluence ページに添付します。
  2. そのページの添付ファイルのリストが表示されます。
  3. 画像を右クリックし、その保存場所をコピーします。
  4. 上記の通り、PDF スタイルシート内の適切な src="" 属性にリンクを貼り付けます。
  5. /download/... の前の、URL の最初の部分を削除します。

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 Numbering to a Header or Footer

ページ番号を追加するには、 PDF レイアウトでカスタマイズされた HTML と PDF スタイルシートでカスタマイズされた CSS を組み合わせる必要があります。
  1. PDF レイアウト HTML: フッター セクション (またはヘッダー セクション) で、ページ番号のプレースホルダーとして機能するための一意の ID、たとえば pageNum, を空の span 要素で使用します。

    HTML - PDF レイアウト:フッターセクション
    <span id="pageNum"/>
    
  2. PDF スタイルシート CSS:空の span に適用するために、以下の CSS セレクタ ルールを作成します。

    CSS - PDF スタイルシート
    #pageNum:before
    {
    content: counter(page);
    }
    

上記の CSS セレクタルールを詳細に分析します:

  • #pageNum ルールは、指定した「pageNum」ID を値として持つ HTML 要素、つまりヘッダーやフッター用に作成した span 要素を選択します。
  • セレクターの :before 部分は、span 要素が処理される前にコンテンツを挿入できるようにする疑似クラスです。
  • counter(page) は、現在のページ番号をコンテンツとして返す関数です。
  • content プロパティは CSS プロセッサに対し、動的コンテンツ (つまり、インクリメントされるページ番号) が span タグに挿入されることを示します。

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

  1. Go to a page in the space and choose Browse > Advanced.

  2. Click PDF Export in the left-hand panel.
    This option will only be visible if you have the 'Export Space' permission.
  3. 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.
  4. [エクスポート] をクリックします。
  5. When the export process has finished, download and save the PDF file as prompted.



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 Universal Plugin Manager documentation.
  • 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