|
Please take note of the following points:
独自の HTML を追加して、PDF 出力のタイトルページ、ページヘッダ、ページフッタをカスタマイズできます。
To customise the PDF layout:
You can adjust the appearance of the PDF pages by editing the CSS stylesheet.
PDF スタイルシートをカスタマイズするには:
There are two PDF export methods (see Exporting Confluence Pages and Spaces to PDF):
To make your PDF layout customisations apply to a single page exported to PDF, either:
This section provides examples of typical customisations that you can add to your PDF stylesheet. Once you are familiar these basic customisations, you may wish to try some advanced customisations.
Modifications to page and margin sizes are made in the @page CSS rule. To make changes to this rule, implement the following type of code in the PDF stylesheet.
@page
{
/*Page specific styles (that is, customisations of properties) go here*/
}
|
The default page size is based on the locale of your Confluence server. For example, if this server is located in the US then the default paper size of your PDF export will be US Letter size (8.5 inches wide by 11 inches long). If the server is located in Australia, the default paper size will be A4 (210 mm wide by 297 mm high).
To modify the page size to A4, add a size property to the top of the rule like this:
@page
{
/*The A4 paper size is 210 mm wide by 297 mm high*/
size: 210mm 297mm;
}
|
More information about paper sizes can be found on Wikipedia.
To add a margin of 15 mm to a paper size of A4, your CSS @page rule would look like this:
@page
{
size: 210mm 297mm;
margin: 15mm;
}
|
By default, a table of contents will be generated after the title page, or at the beginning of the document if no title page is defined in the PDF layout. To make changes to the look and layout of the table of contents, define the appropriate CSS rules in the PDF stylesheet.
For details about the default CSS rules applied to the table of contents, download the default CSS rules (from the link above) and examine the specific rules with toc in their name.
To prevent the table of contents from being generated in your PDF document, add the div.toc rule to the PDF stylesheet and set its display property to none:
div.toc
{
display: none;
}
|
The leader character is used to link the name of a heading in the table of contents with its page number. The page number is usually aligned to the right-hand margin of the page. By default, the leader character is the '.' (dot) character. You can change it by customising the leader character CSS rule span.toclead:before and adding this to the PDF stylesheet.
To change the leader character to a solid line, modify the CSS rule to:
span.toclead:before
{
content: leader(solid);
}
|
To change the leader character to spaces, modify the CSS rule to:
span.toclead:before
{
content: leader(space);
}
|
(Be aware that using a space as a leader character can make the table of contents difficult to read.)
In order to break long words or words that are not separated by whitespace, add a selector to the PDF stylesheet containing the word-wrap property with a value of break-word:
div {
word-wrap: break-word;
}
|
スタイルシートを使用すれば、最終文書のルックアンドフィールに影響を与える出力は何でもカスタマイズできます。これにはフォント、表、行間隔、マクロなどが含まれます。エクスポート エンジンは Confluence によって生成された HTML 出力から直接機能します。したがって、何かをカスタマイズする第一歩は、Confluence または Confluence マクロによって生成された HTML 要素のセレクタを見つけることです。次に、PDF スタイルシートに CSS ルールを追加します。こうして PDF エクスポートにカスタマイズが表示されます。
h1、h2 など。Confluence はエクスポートされたスペースの階層構造に応じて見出し要素を変更し、スペース エクスポート全体に統一された外観を適用します。つまり、見出しのレベルが下げられます。これはカスタム PDF スタイルシートの適用に影響を与えます。CSS スタイルを正しく適用するために、見出しの変更量を算出できます。見出しのレベルはエクスポート ツリーの深さの値に応じて下げられます。第 1 レベルのページは 1 つ下げられます (すべての <h1> 要素は <h2> 要素になる)。第 2 レベルのページは 2 つ下げられ、同様に続きます。Advanced PDF Stylesheet Customisations