How do I change the font sizes in PDF export?
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Purpose
The following KB will cover how to change the font size of both headers and content in a PDF Export.
Solution
Changing the format of PDF exports will require us to add our own HTML to customize.
Setting a global PDF layout
- Choose the cog icon , then choose General Configuration under Confluence Administration
- 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 the space level
- Go to the space and choose Space tools > Look and Feel from the bottom of the sidebar You'll need Space Admin permissions to do this.
- Choose PDF Layout.
- Choose Edit.
If your space uses the Documentation theme:
- Choose Browse > Space Admin from the header
Note: The Space Admin option appears only if you have space admin permissions, or if you're part of the 'confluence-administrators' group.
- Choose PDF Layout in space administration options.
- Choose Edit.
Changing Headers Font Size
Add the following code in the PDF layout section:
.wiki-content h1
{ font-size: 50px; }
Please note that Confluence has a Demotion of heading elements which means that .wiki-content h1 is the element for Page Title, while .wiki-content h2 is the element for Header 1 and so forth. This information is quoted from this documentation: Customize Exports to PDF
Changing Content Font Size
Add the following code in the PDF layout section
body,p,li,td,table,tr,.bodytext,.stepfield
{ font-size: 8pt; }