Insert logo for PDF export header

Van Le April 7, 2022

Hi,

I am trying to insert a logo into the header of the exported PDF. I am following the instructions on Advanced PDF Export Customizations, but the exported PDF is not showing the logo image. This is the html code I have in the header section: 

<div style="margin-top: 2.54cm;">
<img src="download/attachments/2509963270/logo.png">
</div>

The image is uploaded in the same workspace, with the URL taken from the Attachments tab. Completed URL is (https://sentify.atlassian.net/wiki/download/attachments/2509963270/logo.png?api=v2).

 

Could someone please take a look into what could go wrong in my case? Many thanks in advance.

 

Van

4 answers

2 accepted

0 votes
Answer accepted
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 8, 2022

Hi Van Le,

Welcome to Atlassian Community! I'm happy to help you.

First, be aware that edits made in the Space Settings apply to Full Space exports only. If you want a single page export specifically, make sure you create it from Space Settings > Export Space, and choose custom export, where you can select the single page you want to export.

I can get this to work with the default 10.0mm margin size, but not once I change it to 2.54cm or 25.4mm, so I believe setting the margin larger might be what's causing the issue. Note:

Very large images can spill over into the body of a page or alter the position of text or other elements used within a header or footer. In such situations, it is recommended that you reduce the size of the image and then attach it to your Confluence page again. If you prefer to keep the image size and want to move the content lower instead, you can do so by configuring the margin-top properties in the @page CSS rule.

In this case, you can try making this modification in the PDF stylesheet section instead. I got the below page margins from Customize Exports to PDF

@page
{
margin-top: 2.54cm;
margin-bottom: 2.54cm;
margin-left: 1.27cm;
margin-right: 1.27cm;

@top-left
{
background-image: url('/download/attachments/2509963270/logo.png');
background-size: 250px 86px;
background-repeat: no-repeat;
background-position: left center;
height: 86px;
width: 250px;
}
}

I set the background-size and height/width according to my logo, but you can adjust it for yours.

Let me know if that works! I tested it with my logo, and I can confirm it works well.

Take care,

Shannon | Atlassian Cloud Support

0 votes
Answer accepted
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2022

Hi @Van Le ,

welcome to the Atlassian community!

if you are on the cloud, as specified in the tag, you are checking on the wrong place. Documentaion posted in your description is for Server and Data Center instances.

Please take a look here https://support.atlassian.com/confluence-cloud/docs/customize-exports-to-pdf/ 

Hope this helps,

Fabio

1 vote
Van Le April 7, 2022

I have followed a few other suggestions from similar posts but couldn't get it to work. Look forward to hearing from you.

0 votes
Van Le April 12, 2022

thank you, issue resolved

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events