PDF layout in one page

Hi,

I know that it's imposible in Confluence to customize the PDF layout when export one page to PDF from the view of page (Tools -> Export PDF), but I want to ask:

It is posible to edit the PDF global layout (even if it means changing aply to all spaces of my system) to put an image of my company logo? I wonder if there is any way possible to do this, even if it means making internal or global changes ...


Thanks in advance!

1 answer

1 accepted

You can include an image in single page exports using custom PDF stylesheets. This example would insert the image (attached to your Confluence instance) in the top right corner of yoru page:

@page
{
    @top-center
    {
        background-image:url('/download/attachments/12345/image.jpeg');
        background-repeat:no-repeat;
        background-position:right top;
     }
}

Thanks Alex!

I don't know that in stylesheet I can import a image... :( i'm newbie in CSS!

@Alex:

Sorry, but this does not work for me. I am not able to place an image to a single page PDF export. Neither if I add the lines to the space PDF Stylesheet nor to the Global PDF Stylesheet. Where am I going wrong? The URL is correct because I can show the image in the browser.

Hi Bruce.

I have tested the CSS and I can confirm they work.

Are you using the PDF conferter bundled with Confluence? Note that the image should only be visible in your page exports and not whe you see the page in your browser.

@Alex:

I just tried in our test system and if I only add the image it will be displayed. So I will go through my CSS to see if I find any problematic entries. Thanks again for testing.

@Alex:

Thanks for testing, yes we use the PDF Eport functionality within Confluence (4.3.2) and I am aware that the logo only shows up in the PDF. For the pages we use the space logo. But perhaps I have problem inside my CSS. I will delete all other entries and just try the one and see where it will get me. I will keep you updated.

@Alex:

Some more news on this. I originally intended to have something like this

@page 
{
    size: 210mm 297mm;   
    margin-top: 2.0cm;
    margin-bottom:1.4cm; 
    margin-left: 1cm;
    margin-right: 1cm;
    padding: 1em;
    
    @top-left
    {
        background-image:url('/download/attachments/5342557/image.jpg');
        background-repeat:no-repeat;
        background-position:center;  
    }
    
    @top-center
    {
        content: "JUST PUT SOME TEXT HERE";        
        font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif;          
        font-size: 6pt;     
    }

    @bottom-left  
    {
       margin-left:0.5cm;
       content: "JUST PUT SOME TEXT HERE";  
       font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif;         
       font-size: 6pt;   
       vertical-align:top;
    }

    @bottom-right
    {
        content: counter(page) " / " counter(pages);  
        font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif;        
        font-size: 6pt;  
        vertical-align:top;
        text-align:right;
    }
}

This does not work as the text seems to hide the image. I found a workaround for now by adding the image part into the "center section" infront of the text. So now I have both text and image. This leads to my next question, is there any way to have a watermark behind the text? Or must I use something like Scroll PDF to achieve this?

Suggest an answer

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

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

68 views 3 2
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