how to get a Graphic on the Page Title in the PDF Export Title Page

Susan Kraft-Yorke April 1, 2021

I inherited a Confluence space where I need to export Jira information to PDF with a Logo on the cover page and footer info. He started the Style sheet with 

.pagetitle h1 {

background-image: url(https://confluence.xyz.tech/download/filename.jpg)

background-position: center top;

background-repeat: no-repeat;

etc.

}


On one child page, this works. On all other pages, the logo randomly shows up and creates a lot of post-export work. 

The person who put this PDF stylesheet together only used the PDF stylesheet. 

I moved code to the PDF layout, thinking this is where you put the Title page and footer content. It works for the footer and is impressively stubborn in not showing any graphic on the title page. I even went back to trying to get the graphic in place with the PDF Stylesheet, but there it is either on every page as a background, or not showing at all unless I use the original code - which is not ideal as I stated at the beginning.

This is the PDF Layout Export Title Page code:
fsTitle {
 .pagetitle h1
 {
 font-size: 36px !important;
 margin-left: 250px !important;
 padding-top: 300px !important;
 page-break-after:always;
 }
 {
 background-image:  url(https://confluence.plume.tech/download/attachments/51780125/Plume_SP_Triple_Symbol_Wordmark_Stacked.jpg?api=v2);
 background-position: center top;
 background-repeat: no-repeat;
 background-size: 75%;
 margin-left: 000px !important;
 padding-top: 700px !important;
 page-break-after:always;
 }
}

The PDF style sheet, I reused and modified from the Atlassian "Expert PDF CSS field example" and removed any fsTitle or .pagetitle h1 calls, as I already used them in the PDF Layout.

1 answer

1 accepted

1 vote
Answer accepted
Vero Rivas
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.
April 1, 2021
Susan Kraft-Yorke April 2, 2021

Vero,
That is basically the same design the first owner used. 

It worked (as does this solution) for the child page he built it for, but for other docs/pages, it sends the logo to random pages and positions on subsequent pages. 

Now I can see the .pagetitle is defined as H1, so then in the Confluence settings that this style sheet triggers with all H1s and adds place logos. But... it doesn't do a page break, and it ignores the no-repeat instruction.

Thanks for showing me this is truly an answer. I just had to read it more closely!

- Susan

Like Vero Rivas likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events