heatedlinetco Posted April 4, 2019 Share Posted April 4, 2019 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 More sharing options...
hozawa Posted April 4, 2019 Share Posted April 4, 2019 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 More sharing options...
Friendly User Posted April 4, 2019 Share Posted April 4, 2019 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now