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

Text wrapping in PDF


nockdg

Recommended Posts

Hi,

We are experiencing a strange problem with text wrapping when saving as a PDF. The print preview is fine.

e.g. ABCDE appears as

ABCD

E

The field is large enough to hold all the required data. If I set the field to be bold or lower-case the data, it appears fine in the PDF.

I've also tried setting the linebreak policy using:

   jp.setProperty("net.sf.jasperreports.export.pdf.force.linebreak.policy", "true");[/code]

Currently using JasperReports 4.1.1 and can't update at the moment.

Thanks,

Dave

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I've tried different fonts and sizes and haven't found a combination that works. 

<elementGroup>	<textField isStretchWithOverflow="true">		<reportElement positionType="Float" x="0" y="20" width="90" height="18" stretchType="RelativeToTallestObject"/>		<textElement>			<font fontName="Calibri" size="11" isBold="true"/>		</textElement>		<textFieldExpression class="java.lang.String"><![CDATA["Status:"]]></textFieldExpression>	</textField>	<textField isStretchWithOverflow="true">		<reportElement positionType="Float" x="100" y="20" width="400" height="18" stretchType="RelativeToTallestObject"/>		<textElement>			<font fontName="Calibri" size="11" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>		</textElement>		<textFieldExpression class="java.lang.String"><![CDATA["ABCDE"]]></textFieldExpression>	</textField></elementGroup>[/code]

The report consists of about 15 rows of data formatted as above. The problem only occurs with a couple of fields and the only difference I can see is that the data has a higher proportion of capital letters.

The fields in each row are all exactly the same size. Some rows have much longer data and that all displays fine in the pdf.

Thanks

Dave

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