How to insert image in header for exporting to PDF
Asked by Helen Xu:

I need to insert a logo into the header of the exported PDF. I'm putting html code in PDF Layout according to the instructions on [Advanced PDF Export Customizations](https://confluence.atlassian.com/doc/advanced-pdf-export-customizations-198806890.html), but the exported PDF is not responding to the changes. Only PDF stylesheet responds to changes I made.


Answers:
author: Sireesha Dugginapeddi [Appfire]
body: Hi [@Helen Xu](/t5/user/viewprofilepage/user-id/2335131),

The instructions in the link you provided state that the "src attribute" of the image must be added in the PDF Layout as well as [PDF Stylesheet](https://confluence.atlassian.com/doc/advanced-pdf-export-customizations-198806890.html?_ga=2.193122793.539189585.1543227038-748161253.1533556773#AdvancedPDFExportCustomizations-AddingImagestoHeadersandFooters) (instructions Step 3) to view the expected output.

I have used this feature in the past. Once you add the image link in your header or footer syntax as 'background-image' in the stylesheet, you should be able to view the image in the exported output.

Hope this is what you were looking for!

Thanks

Sireesha

comments: author: Helen Xu
body: Hi [@Sireesha Dugginapeddi \[Appfire\]](/t5/user/viewprofilepage/user-id/1260000),

Thanks for the reply!

I have added the following to the Stylesheet but it's still not working. Any help would be appreciated.

....

@page {  
@top-center {  
content: "Blah Blah.";  
font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif;  
font-size: 8pt;  
background-image: url("<https://confluence.atlassian.com/download/attachments/12346/header-image.png>");  
}

.....

Thanks!

Helen


author: Sireesha Dugginapeddi [Appfire]
body: Hi [@Helen Xu](/t5/user/viewprofilepage/user-id/2335131),

For background-image url, use the path from [/download/attachments/12346/header-image.png](https://confluence.atlassian.com/download/attachments/12346/header-image.png) and not [https://confluence.atlassian.com/download/attachments/12346/header-image.png](https://confluence.atlassian.com/download/attachments/12346/header-image.png?_ga=2.121483341.437404411.1543522592-748161253.1533556773).

Also, as explained in the article, copy the image location from the Confluence page it is attached to and use the URL as mentioned earlier (from /download/attachments.....)

Hope this works out!

Thanks

Sireesha


author: Helen Xu
body: [@Sireesha Dugginapeddi \[Appfire\]](/t5/user/viewprofilepage/user-id/1260000)

Thanks for the clarification! Now I have the logo appear in the header.

I'm noticing whatever I do in pdf layout, the export is not responding to it. It's only using the stylesheet... I even deleted the whole html code and the header words in pdf layout, the export still shows everything on.... So I just edited the css code to include positioning etc.

Thanks again!

Helen


author: Aparna R
body: HI,

I am not sure about the location or file path of the image?

Any help would be appreciated


author: Aparna R
body: HI Helen, could you help me with this!


author: Mark Walsh
body: Hi [@Aparna R](/t5/user/viewprofilepage/user-id/3569736)

For the file path of the image,

1. Insert an image to a page in a space
2. Go to Space Setting in that Space, view the list of attachments, then right-click the image and copy its location.

Hope this help :)

Ref: <https://confluence.atlassian.com/doc/advanced-pdf-export-customizations-198806890.html>


Tags: layout

stylesheet