Jump to content
We've recently updated our Privacy Statement, available here ×

Text Field Bold style is not working on PDF download


heatedlinetco

Recommended Posts

I have a text field with isBold="true" and fontName="SansSerif", but when I generate PDF, Bold is not prominent. Below is my code:

<textField>
                <reportElement x="0" y="21" width="572" height="20" uuid="368bae58-dd72-476d-9b1d-6a3f83ae0f78"/>
                <textElement textAlignment="Center">
                    <font fontName="SansSerif" size="14" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{distributorName}]]></textFieldExpression>
</textField>

Please suggest some solution, I want to make my text field Bold.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

That's probably because there's no sanserif bold font in your environment. You'll need to download san serif bold font and setup font extension.

I haven't tried the following site but just as an example.

https://fontzone.net/font-download/ms-reference-sans-serif-bold

 

Setting up font extensions. Need to specify Normal, Bold, Italic, and Bold Italic fonts in font family.

https://community.jaspersoft.com/wiki/custom-font-font-extension

Link to comment
Share on other sites

SansSerif is a logical font and will be replaced with some other font that is available to the JVM and is marked as go-to Sans Serif type font. This is a "logical" font. Try using an actual font in your case like Times New Roman or Djvu Sans. You also need to package the font as a font extension (JSS Preferences -> Jaspersoft Studio -> Fonts -> Add font and export it as a JAR) and add it to your classpath. In your font extension you specify the normal, bold, italic and bolditalic variants of the font. Most likely your application does not have any bold fonts and cannot add them to the PDF.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...