format of code block in proportional font in .pdf

George Cathcart February 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 February 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 February 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
TAGS
AUG Leaders

Atlassian Community Events