It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

PDF Stylesheet - any guides out there?

Any guides out there for how to work with the stylesheet for PDF? I am including a person's profile (via a macro) on a page, and it displays the whole profile when I export to PDF. Unfortunately, the rendering is completely off when it goes to PDF. Problems include:

1) inadequate space between profile block and next element, namely the next table cell in the display.

2) On screen, the person's name lines up with their image. Not so in PDF rendering.

3) Drop shadow is gone (this is NOT important to me, but it is a rendering failure, I think.

4) background color of the profile block doesn't carry over to print.

Any guidance appreciated.

3 answers

1 vote
Thomas Schlegel Community Leader Mar 26, 2012

Hi,

I think you already know this page: http://confluence.atlassian.com/display/DOC/Customising+Exports+to+PDF ?

Best regards

Thomas

I have seen this, it is helpful, to a point. I'm trolling other answers now, looking if there are any tips I'm missing.

I see ScrollWiki in my future, though....

@Matthew:

The numbering in the toc comes from the confluencedefaultpdf.css. There are lines like this:

div.toclvl0:before {
    content:  counter(chapter) ". ";
    counter-increment: chapter;  /* Add 1 to chapter */
    }

If you want to get rid of the numbering you must override this by adding some new lines to your PDF export stylesheet. Try something like this:

div.toclvl0:before, div.toclvl1:before {
    content:"";
    }

As regards some general guidance:
I learned that the PDF export uses CSS 2.1 and so any documentation on CSS 2.1 should get you started.

Steffen

Thank you, Steffen! That worked like a charm.

I'll have to dig deeper into confluencedefaultpdf.css to learn how Confluence labels the pieces of the page so I can get my CSS selectors right.

+1 to this request. I've looked at all the Confluence help pages, but nowhere do I see a complete reference for all the elements that show up in the PDF and how I would reference them from PDF CSS.

At present, I'm looking for a way to customize the TOC numbering in the PDF. Entries in the TOC default to be numbering with 1, 1.1, 1.1.1, etc., followed by the name of the page. I'd like to remove the numbering altogether, since the numbering shows up nowhere else in the document and is visually cluttering.

The following DOESN'T work in my PDF CSS (though it seems like it should).

  1. div.toc ol
  2. {
  3. list-style:none;
  4. }

Any tips or pointers to complete PDF CSS documentation is appreciated.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Introducing Confluence Cloud and Jira Software Cloud Premium

Wherever you are in your team’s journey , our goal is to support your big ambitions. We’re a cloud-first company with the mission of unleashing the potential of every team, and to address the range ...

600 views 4 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you