How to add tahoma font to pdf export?

Shiva Kumar December 24, 2018

i tried adding tahoma font to pdf export by CSS and few other ways but it isn't working.

could anyone help me on this? 

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 26, 2018

Hello Shiva,

Customizing a PDF export can really give your content a distinct and original feel. When editing the PDF export Stylesheet to change the font type, there is a simple CSS to apply:

body,p,li,td,table,tr,.bodytext,.stepfield
{ font-family: "Tahoma"; }

Using the above CSS stylesheet will transform your PDF export into a new font family. This was confirmed on Confluence Server 6.13.0.

Here is the before and after on the export:

  •  Before:
    • image.png
  • After:
    • image.png

I hope this helps you to adjust the font family of your exported PDFs, please let us know if we can be of any more assistance.

Regards,
Stephen Sifers

Shiva Kumar December 26, 2018

Hello Stephen Sifers,

My organisation currently uses Confluence 6.4.1 server.

The CSS given is not working in this version.

Could you please help me to get Tahoma font for pdf export on Confluence 6.4.1 server?

 

Thank You!

 

Warm Regards,

Shiva Kumar

Like Stephen Sifers likes this
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 27, 2018

Hello again Shiva,

For Confluence 6.4.1 there are only a few included fonts (Times New Roman, Helvetica or Courier). In order to bring in more fonts, you will need to reference the front file (ttf) within the stylesheet. Here is more about Incorporating Other Fonts for Confluence 6.4.

By default, Confluence provides Times New Roman, Helvetica or Courier fonts for use in PDF exports. You can use your own fonts for PDF exports by declaring them in a @font-face CSS rule in your PDF Stylesheet.

The following CSS rule example shows how to declare the Consolas font and apply it to some elements for your PDF export:

CSS - PDF STYLESHEET

@font-face { src: url(file:///usr/share/fonts/Consolas.ttf); -fs-pdf-font-embed: embed; } .code pre, .preformatted pre, tt, kbd, code, samp { font-family: Consolas, monospace; font-size: 9pt; }

The font path specified in the CSS must be the path to the font on the Confluence server.

Confluence 6.13 does allow you to reference a font type without needing the font file.

I hope this helps clarify the functionality of adding a PDF export stylesheet for Confluence 6.4.

Regards,
Stephen Sifers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events