2001 JI Open Discussion Posted August 17, 2006 Share Posted August 17, 2006 By: Claudio Pi - claudiopi Long text problem (pdf) 2002-12-22 07:51I'm new to JasperReports. I'm trying to print a long text that expands multiple lines: I have the following for that text: <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" > <reportElement mode="Transparent" x="3" y="3" width="525" height="12" forecolor="#000000" backcolor="#FFFFFF" positionType="Float" isPrintRepeatedValues="false" isRemoveLineWhenBlank="false" isPrintInFirstWholeBand="false" isPrintWhenDetailOverflows="false"/> <textElement textAlignment="Left" lineSpacing="Single"> <font fontName="" pdfFontName="Helvetica" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String">$F{Descr}</textFieldExpression> </textField> The problem is that when generating a pdf file the text cuts in a random fashion, but when generating the HTML file I can see the complete text. The only way I found to have the text complete in the pdf is to increase the height attribute, but this is not a solution since I want the next element to be as close as possible to this and also because I don't know the exact lenght of the text. Have someone came through this before ? Thanks, Claudio. PS: I'm using version 0.4.4. By: Claudio Pi - claudiopi RE: Long text problem (pdf) 2002-12-23 05:23If someone else has the same problem, I already found the answer: It's a bug of iText api (I was using version 0.92 that's the one included with iReport 0.0.7). Upgrade to 0.96 and problem is fixed. By: Claudio Pi - claudiopi RE: Long text problem (pdf) 2002-12-23 05:45If someone else has the same problem, I already found the answer: It's a bug of iText api (I was using version 0.92 that's the one included with iReport 0.0.7). Upgrade to 0.96 and problem is fixed. By: Atipon - atipon_p RE: Long text problem (pdf) 2002-12-26 03:01I have the same problem but the itext version 0.96 doesn't help. I think the cause is a true type font and unicode(test with thai language). It seems like the font size in pdf is not correct as setting in jasper design. With some font (e.g. tahoma.ttf) Font size in pdf is big,so it makes the long text cuts in random. But another (e.g. CORDIAU.TTF), the font size in pdf is very small so I can see the whole text but the text field looks like it has some blank lines in the bottom. In both case I used stretch with overflow textfield. Please help. Thanks, Atipon 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