Jump to content

JasperViewer vs PDF line breaking problem


clucas

Recommended Posts

I have a report field that can have data in it where there are no spaces for a long run a characters.  For example 'Color: green,red,blue,black,white,yellow,pink,maroon'.  (There is a space after the colon)

 
I see different line breaking behavior in JasperViewer versus the result in a PDF.  This is with net.sf.jasperreports.export.pdf.force.linebreak.policy set to true.  Also, to the best of my knowledge the fonts are the same.
 
In JasperViewer the above example will break at after the comma that follows the word yellow while in the PDF the line break is where the space is after the colon.
 
In other words it looks like this --
In JasperViewer
Color: green,red,blue,black,white,yellow,
pink,maroon
 
As a PDF
Color:
green,red,blue,black,white,yellow,pink,ma
 
This is causing a problem because the last part of the field is getting cut off.  Notice how the word maroon is truncated.
 
Is there any way I can prevent my data from being truncated in a PDF?  Is this expected line breaking behavior even with net.sf.jasperreports.export.pdf.force.linebreak.policy set to true?  Is there a different parameter to get the two rendering systems to line break the same?  Anything else I should try?
 
I have attached the jrxml file that demonstrates this problem.
 
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 years later...

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...