Suggested improvement: allow PDF template customizations that apply to single page exports

Joel Wilhelm October 16, 2019

It would be vastly beneficial if editing the PDF export template was easy, and if it applied to single page exports, not just site exports.

1 comment

Herve Frydlender
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.
October 16, 2019

Hi Joel,

Did you had a look here and here. You'll see instructions on how to customize the PDF style-sheet used when doing a page "Export to PDF".

Joel Wilhelm October 17, 2019

I had looked at the first link, and it says:

Limitations

There are a few limitations to be aware of:

Changes to the PDF layout only apply to space exports, not to single page exports (via > Export to PDF).

Herve Frydlender
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.
October 18, 2019

Indeed. Their is two ways to configure PDF export:

  • PDF Layout : applies to space export only
  • PDF Stylesheet : applies to both space & page export

Here is a sample configuration you can copy / paste:

@page {
/* Make the page portrait A4 */
size: 210mm 297mm;

/* Add page / pages in bottom center */
@bottom-center {
font-size: 12pt;
color: #A9A9A9; /* DarkGrey */
content: counter(page) " / " counter(pages);
}

/* Nothing bottom right */
@bottom-right {
}

/* Nothing bottom left */
@bottom-left {
}
}

/* Change first page */
@page:first {
/* Reserve space above */
margin-top: 150px;

/* Reserve space below */
margin-bottom: 100px;

/* Company logo top left*/
@top-left {
background-image: url('http://www.gravatar.com/avatar/9ee967af14a1a987eae3bc9f5d88facb?s=100');
background-repeat:no-repeat;
background-position:left center;
}

@bottom-center {
font-size: 6pt;
font-style: italic;
color: rgb(69,0,204);
content: "This document is the property of COMPANY. It shall not be copied and / or disclosed to third parties, in any form without COMPANY written permission.";
}

}

body,p,li {
font-size: 12pt;
font-weight: normal;
}

/* Smaller font size for tables and TOC */
th, tr, td, toc-item-body {
font-size: 10pt;
}

/* Avoid page break after table header and inside table row */
th { page-break-after:avoid; }
tr { page-break-inside:avoid; }

/* Add numbering to section headers h1 to h4 */
/* Reset counter */
body {counter-reset: h1}
h1 {counter-reset: h2}
h2 {counter-reset: h3}
h3 {counter-reset: h4}
/* No counter on specific H1 i.e. Content table */
h1.ncount:before {content: normal}
/* Increment counter & update content */
h1:before {counter-increment: h1; content: counter(h1) ". "}
h2:before {counter-increment: h2; content: counter(h1) "." counter(h2) ". "}
h3:before {counter-increment: h3; content: counter(h1) "." counter(h2) "." counter(h3) ". "}
h4:before {counter-increment: h4; content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) ". "}

/* Page break before main sections, avoided after */
h1 {
font-size: 18pt;
page-break-before: always;
page-break-after: avoid;
color: rgb(0,54,160);
}

h2 {
font-size: 14pt;
page-break-after: avoid;
color: rgb(0,81,239);
}

h3 {
font-size: 12pt;
page-break-after: avoid;
}

h4 {
font-size: 12pt;
font-weight: normal;
page-break-after: avoid;
}

/* Fix display issue with Jira tickets */
span.jira-issue {
display: inline;
}

/* Fix default behavior on table's colum width */
table
{
table-layout: auto !important;
width: auto !important;
word-wrap: normal;
}

/* Fix background color of tables */
table.confluenceTable td.confluenceTd.highlight-grey { background-color: #D3D3D3;}
table.confluenceTable td.confluenceTd.highlight-red { background-color: #FF6347;}
table.confluenceTable td.confluenceTd.highlight-green { background-color: #90EE90;}
table.confluenceTable td.confluenceTd.highlight-blue { background-color: #87CEEB;}
table.confluenceTable td.confluenceTd.highlight-yellow { background-color: #FFD700;}

Like Jonathan Kelly likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events