Export Beautiful Code Examples from Confluence to PDF

We're happy to announce that Scroll PDF Exporter now supports syntax highlighting for code examples. It had been our top-voted feature, and it was a bit tricky to implement, but now exporting code examples should work for everyone just right.


Code Block Macro in Confluence

The Code Block macro in Confluence allows users to display code example with syntax highlighting on a Confluence page. Syntax highlighting means, that depending on the programming language of the code, certain keywords are highlighted, so that the code example is better readable.

Code Block Macro in Confluence

Of course syntax highlighting is also something which absolutely makes sense when exporting documentation to another format, which is why syntax highlighting was the top-voted feature for our Scroll Exporters. However, the way how the Code Block macro works required us to re-implement the syntax highlighting in the Scroll Exporters. Btw: Syntax highlighting is not yet supported by the built-in PDF exporter of Confluence.

Syntax Highlighting Themes

Finally, we made sure that the options for the syntax highlighting works for everyone: Users can select a theme for the syntax highlighting for each code example macro individually. However, if you need to make sure that all code example use the same theme in your export, we provide a way to configure in the Scroll PDF templates how the code examples are outputted:

  1. By default the code examples are exported with the default theme that looks good in PDFs and print outs.
  2. If the code example should be outputted exactly how they are defined in Confluence, you can enable this in the template editor.
  3. If all code examples should look the same way, but different from the default theme (#1), this can be configured in the export template.

PDF with Default Theme

Get Scroll PDF Exporter now!

The new syntax highlighting is available in the Scroll Exporters starting in version 3.1 (available today on the marketplace). Please note, that syntax highlighting is not available for Scroll Office yet.


Related Articles

Cookie Policy

We use cookies to create a secure and effective browsing experience for our website visitors and to understand how you use our site (i.e. Google Analytics). For more information please read our privacy statement .

OK