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

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

  1. Choose the cog icon , then choose General Configuration under Confluence Administration.
  2. PDF レイアウトを選択します 。入力した HTML および CSS は、PDF タイトルページやページヘッダー、フッターにレンダリングされます。

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

  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. PDF レイアウトを選択します。
  3. 編集を選択する。

スペースでドキュメント用テーマを使用している場合:

  1. Choose Browse > Space Admin at the top of the screen.
    Note: The 'Space Admin' option appears only if you are a space administrator for the space or you are a super user (a member of the confluence-administrators group).
  2. スペース管理オプションから PDF レイアウト を選択します。
  3. 編集を選択します。

スペースが PDF にエクスポートされるとき、次のエリア用に生成される HTML をカスタマイズできます。

  • PDF Space Export Title Page - タイトルページ。
  • PDF Space Export Header - ページヘッダー。
  • PDF Space Export Footer - ページフッター。

必要に応じて、それぞれのテキストボックスにカスタマイズ内容を入力してください。PDF レイアウトセクションでは HTML コードが有効です。HTML にインライン CSS を含めることもできます。

Editing the PDF stylesheet

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

  1. Choose the cog icon , then choose General Configuration under Confluence Administration.
  2. ルックアンドフィール > PDF スタイルシートを選択します。次の画面で、各ページのコンテンツをレンダリングする CSS コードを入力し、保存できます。

スペース PDF スタイルシートを設定する

  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. PDF スタイルシートを選択します。
  3. 編集を選択します。
  4. カスタマイズを入力します。

スペースでドキュメント用テーマを使用している場合:

  1. Choose Browse > Space Admin at the top of the screen.
    Note: The 'Space Admin' option appears only if you are a space administrator for the space or you are a super user (a member of the confluence-administrators group).
  2. スペース管理オプションから PDF スタイルシート を選択します。 
  3. 編集を選択する。 
  4. カスタマイズを入力します。

この 「PDF エクスポート スタイルシート」ページには、PDF スタイルシートの現在の(例えば、カスタマイズされた)コンテンツが表示されます。 

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

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

Confluence ページを PDF にエクスポートすることができます。このオプションは 1 枚のページをエクスポートし、そのページを表示する権限を持つすべてのユーザーが使用できます。

  • 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. [エクスポート] を選択します。
  7. When the export process has finished, download and save the PDF file as prompted.

スペースでドキュメント用テーマを使用している場合:

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

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. 

注意

  • 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 OnDemand.)
  • 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.
次のステップ

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

  • ラベルなし