How do you change the font size on the PDF Export

Brenda Ellinger August 29, 2011

The font size when you print the PDF Export is tiny. How do you increase this size via Stylesheet?

9 answers

1 accepted

4 votes
Answer accepted
Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 30, 2011

Have a look at our documentation on editing the PDF Stylesheet:

You should be able to follow this documentation and, as it suggests, examine the default PDF Export stylesheet (http://confluence.atlassian.com/download/attachments/190480945/confluencedefaultpdf.css?version=1&modificationDate=1243580667083) to get the style changes that you want.

Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 16, 2012

I've updated this answer with new links, as the PDF export documentation has moved around a bit in a recent release.

6 votes
Ira Chandler September 3, 2013

We are using On Demand Confuence. I am sure a lot of this is not needed, but this is what I used to fix it. This is the "custom" css PDF export override:

body,p,li,td,table,tr,.bodytext,.stepfield

{

font-size: 12pt;

/* was 8 */

/*line-height: 1.1;*/

color: #000;

font-weight: normal;

}

.print-only

{

display: none;

}

.monospaceInput

{

font: 12pt monospace;

/* was 10 */

}

h1

{

font-size: 28px;

/* was 26 */

margin: 36px 0 4px 0;

}

h2

{

font-size: 24px;

/* was 20 */

margin: 27px 0 4px 0;

}

h3

{

font-size: 22px;

/* was 18 */

margin: 21px 0 4px 0;

}

h4

{

font-size: 20px;

/* was 16 */

margin: 18px 0 4px 0;

}

h5

{

font-size: 17px;

/* was 14 */ margin: 14px 0 4px 0;

}

h6

{

font-size: 12px;

margin: 14px 0 4px 0;

display: block;

}

h7

{

font-size: 12px;

margin: 14px 0 4px 0;

display: block;

font-style: italic;

}

h8

{

font-size: 12px;

/* was 8 */

margin: 14px 0 4px 0;

display: block;

}

h9

{

font-size: 12px;

/* was 10 */

font-style: italic;

margin: 14px 0 4px 0;

display: block;

}

/* block quote */

blockquote

{

font-style: italic;

border-left-width: 1px;

border-left-style: solid;

padding: 0 20px;

margin: 10px 20px;

}

div.small

{

font-size: 10px;

/* was 9 */

}

h1.pagetitle

{

page-break-before: always;

}

h1.pagename

{

margin-top: 0;

}

.panelMacro td

{

font-size: 1em;

padding: 14px 7px;

}

.panelContent

{

color:#000000;

font-size:0.95em;

margin:0;

padding:0 12px;

text-align:left;

}

.code, .preformatted

{

background-color:#FFFFFF;

}

.preformattedHeader, .codeContent, .preformattedContent

{

background:#FFFFFF none repeat scroll 0 0;

}

.code pre, .preformatted pre

{

font-family:"Courier New",Courier,monospace;

line-height:1.3;

}

pre

{

margin:10px 0;

overflow:auto;

padding:0;

text-align:left;

page-break-inside: avoid;

}

.code

{

border-style:dashed;

border-width:1px;

overflow:auto;

page-break-inside: avoid;

}

RPT Admin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2013

Thank you. This helped me a lot.

Daniel Rivera October 7, 2016

3 years later, and this saved me.  Thank you.

2 votes
Ira Chandler September 27, 2013

@Doug, since you mention it, since I posted this, we needed to STOP the tables from having equal sized columns, and let the tables PDF to whatever width their content required. We did that with:

table

{

border-collapse: collapse;

table-layout:auto;

}

So simple, yet so elusive...

0 votes
Dale Worley June 21, 2017

A partial solution is:

Click on "View Source" under "..." in the menu of page operations at the top.  This pops up a window showing just the body of the page in a fairly natural HTML representation.

The fonts on this page are maybe 50% larger than the fonts on the Export to PDF form, and the browser's print function seems to respect that.

Alternatively, hit enlarge (control-+ or command-+) one or more times and then use the browser print funciton.

0 votes
kimberly anderson January 29, 2014

How do you avoid a page break after the JIRA issues display? It goes to the end of the page and inserts a blank page after the JIRA issues macro.

0 votes
kimberly anderson January 28, 2014

What is the CSS to change the font size of the dynamic JIRA Issues display in the PDF?

Thank you.

0 votes
Doug Schwartz October 16, 2012

I wanted to change the font size of the table cells in my doc. Here are the magic incantations. BTW, I ended up saving the site as an HTML zip blob, extracted a page with a table, and looked at the resulting styles. These only change the font size of the cells.

BTW, I also discovered I could only edit in FireFox (I think I saw this warning somewhere in the docs). IE would eat the Save/Cancel taskbar at the bottom of the edit page and Chrome did not display the TOC (left pane) in the Documentation theme.

.wiki-content td
{
font-size: small;
}
.wiki-content td p
{
font-size: small;
}
.wiki-content td li
{
font-size: small;
}

0 votes
Doug Schwartz October 15, 2012

I love how Atlassian points us to outdated links. Have you guys ever heard of FwLinks? I implemented a PHP solution in my last gig.

Besides, you tell us to look at confluencedefaultpdf.css, which has hardly any comments. How hard would it be to add comments that tell us where each style is used? Don't make the user guess!

Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 16, 2012

Hi Doug.

Sorry, at the time I answered the question (2 months ago), the links were accurate. It looks like the PDF documentation in the Confluence space was recently re-organised.

We do have ID-based addressing in Confluence (eg. https://confluence.atlassian.com/pages/viewpage.action?pageId=190480945) but I chose to insert the non-canonical link in order to include the page title in my answer. I didn't anticipate the page being moved - my bad! :-)

The lack of comments in the default PDF stylesheet is less than ideal, but unfortunately it is not possible to explicitly document every place in which a particular style is used since it is entirely possible for different themes and macros to apply whichever styles they like. If you like, you can create an improvement request on https://jira.atlassian.com/browse/CONF for the Confluence team to provide better in-line commenting for the default PDF Stylesheet.

0 votes
Deleted user January 25, 2012

Hi Brenda,

maybe you want to have a look at our product, the Scroll Wiki PDF Exporter. That makes it is very easy to create custom styled PDF templates for export. Let me know if you need further informatin or any help.

http://www.k15t.com

Cheers, Joe

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events