Download 1. Confluence User Guide

Transcript
Confluence 3.0 Documentation
You can create a title or cover page for an PDF-exported space or subsection using XHTML. Use the PDF Export Title Page section of the
space's PDF Stylesheet to do this. The following XHTML code example uses an inline CSS rule to generate a title page.
<div class="fsTitlePage" style="margin-left:auto;margin-top:75mm;margin-right:auto;">
<img src="/download/attachments/12345/titlepage.png"/>
</div>
In the example above, an image called 'titlepage.png' (attached to a page in a Confluence installation and referenced via its relative URL),
will be centred in the middle of the page.
Adding Headers and Footers
Headers and footers can be added to a PDF-exported space or subsection also using XHTML. Use the PDF Export Header and PDF
Export Footer sections of the space's PDF Stylesheet to create a custom header and footer, respectively. For simple headers and footers,
plain text is sufficient. The following example added to a header or footer will create a simple copyright notice.
Copyright © 2009, Atlassian Pty Ltd.
Adding page numbering to a header or footer
To add page numbering to your documentation, you need to combine some customised XHTML in the header or footer along with some
customised CSS in the PDF Export Stylesheet.
First, create a header or footer with an empty span element and give it a unique id, for example pageNum (although this could be anything).
This is the page number 'place holder' in your exported PDF document.
<span id="pageNum"/>
Next, create the following CSS selector rule for this empty span and add it to the PDF Export Stylesheet:
#pageNum:before
{
content: counter(page);
}
This will add a page number to your header or footer.
Analysing this CSS selector rule in more detail, the #pageNum selects the XHTML 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. Finally, the content property inside the rule tells the CSS processor that
dynamic content (that is, an incrementing page number) is to be inserted before the span tag.
General Formatting
You can also use the stylesheet to customise the output of just about anything else that will influence the look and feel of the final document.
This includes fonts, tables, line spacing, macros, etc. The export engine works directly from the HTML output produced by Confluence.
Therefore, the first step in customising something would be to find a selector for the HTML element produced by Confluence or the
Confluence macro. Next you would add a CSS rule to the PDF Export Stylesheet and your customisation would appear in the PDF export.
Exporting to a Word document
Confluence allows you to export a single page into a Word document. This is extremely useful for emailing around content to non-Confluence
users, printing a document or just creating a backup in Word.
You will require 'Export Pages' permission to export a page to a Word document.
To export to a Word document,
389