Jasper report text justified looks different (Studio vs Java)
Posted on April 4, 2019 at 5:47am
Hi all,
I am using the same jasper's template, the same datasource, the same format. On Jasper Studio justified text looks fine, while generating PDF in Java I get wider spaces in some lines between words. Why it looks different than in Studio? How to fix it? thank you in advance.
Joined: Mar 21 2019 - 4:02am
Last seen: 3 years 11 months ago
Posted on April 4, 2019 at 2:25pm
This usually happens when fonts are different. Try opening a generated pdf file and display it's properties and then fonts to find which fonts are actually being used in the pdf. Check that it is the ones you've intended.
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 9 months ago
Posted on April 4, 2019 at 2:43pm
Make sure you're not using "logical fonts" like Serif, SansSerif or Monospace. They are wildcard fonts and are replaced at runtime with something else that is available to JVM. Studio's JVM might interpret the font differently than Java app due to different classpath or different JVM entirely. Make sure you're using the actual font and have that font packaged in a font extension.
Joined: Oct 8 2009 - 5:59am
Last seen: 2 weeks 1 hour ago
Posted on April 5, 2019 at 3:09am
I set the same font in studio as is used in Java, and difference is still visible. I will try to set additional properties and let know
Joined: Mar 21 2019 - 4:02am
Last seen: 3 years 11 months ago