How do you change the font size on the PDF Export

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

9 answers

1 accepted

This widget could not be displayed.
Joe Clark Atlassian Team Aug 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 Oct 16, 2012

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

This widget could not be displayed.

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;

}

Thank you. This helped me a lot.

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

This widget could not be displayed.

@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...

This widget could not be displayed.

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

This widget could not be displayed.

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 Oct 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.

This widget could not be displayed.

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;
}

This widget could not be displayed.

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

Thank you.

This widget could not be displayed.

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.

This widget could not be displayed.

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

399 views 4 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you