Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

PDF layout in one page

DanielG
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.
January 23, 2013

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

3 votes
Answer accepted
Alejandro Conde Carrillo
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.
January 23, 2013

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;
     }
}

DanielG
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.
January 23, 2013

Thanks Alex!

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

Bruce Schlueter
Contributor
January 24, 2013

@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.

Alejandro Conde Carrillo
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.
January 24, 2013

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.

Bruce Schlueter
Contributor
January 24, 2013

@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.

Bruce Schlueter
Contributor
January 24, 2013

@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.

Bruce Schlueter
Contributor
January 24, 2013

@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
TAGS
AUG Leaders

Atlassian Community Events