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

format of code block in proportional font in .pdf

George Cathcart Feb 11, 2014

We have recently upgraded to Confluence 5.4.2 and I'm having problems with the code macro. On the screen, all is well and the code block is displayed in a non proportional font. However when I export to .pdf , the code block is rendered in a proprotioal font. Having done some more research, I find the code block is written by the syntaxhighlighter script.

I can change the characteristics of the output by adding the following to the html stylesheet changes the screen output, but adding the same to the pdf style sheet does nothing.

.syntaxhighlighter .code .container * {
font-size: 8px !important;
line-height: 20px !important;

Similarly specifying the font in the above in the pdf stylesheet as shown below has no effect. So I am left displaying missaligned contents.

font-family: "courier new", monospace;

Can anyone give me an answer?

2 answers

1 accepted

0 votes
Answer accepted
George Cathcart Feb 23, 2014

Well Atlassian are now looking at the problem, which I believe shows itself only on our installation - their test environment renders everything correctly. We have a JIRA open which is being looked into so this should be closed.

0 votes
George Cathcart Feb 16, 2014

Well, it appears Atlassian does not think this is a problem - it is not part of the 'default' functionality of Confluence which they say only supports one font in the exported .pdf file by default. The question remains, why is a code block displayed on screen in a monospace font nicely color coded by tag/element/command etc (by language) and in a proportional font (in black only) in the .pdf export - especially as this 'worked correctly' in confluence 3.2 while v5.4.2 does allow a monospace font to be used with the <code> tag i.e. {{code here}} in wiki markup. I don't have time to argue with them, especially as they are now ignoring the JIRA so I have written a macro which works (albeit with no colour coding) and uses the html <pre> </pre> tags.

Ours is obviously not to reason why - but I am very disappointed in what I had expected to be 'customer service'.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

917 views 0 19
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