nockdg Posted November 24, 2016 Share Posted November 24, 2016 Hi,We are experiencing a strange problem with text wrapping when saving as a PDF. The print preview is fine.e.g. ABCDE appears asABCDEThe 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 More sharing options...
hozawa Posted November 25, 2016 Share Posted November 25, 2016 Probably a problem with pdffont and with pdffont size. Try using smaller pdf font size. Link to comment Share on other sites More sharing options...
nockdg Posted November 25, 2016 Author Share Posted November 25, 2016 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.ThanksDave 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