rcracel Posted March 28, 2008 Share Posted March 28, 2008 I would like start by apologize that I will not be able to provide any samples of the problem I am experiencing due to the highly confidential data that I work with. I could try to make a mock up jrxml file to simulate this, but maybe someone else has experienced this and might have a quick easy solution. This is a very large project and I have been trying to track this down for quite a while and I believe I just figured out why the text is actually being dropped. I will try to elaborate on that a little, but let me know if you need more details. I have a multi page report, with multiple long text fields. Sometimes (rarely) the last couple of words on a text dropped depending on the length of the text. By the length of the text I mean an exact number of words (more accurately characters) and not necessarily the length of the text. I have checked my fonts and I know the font I am using is present and accessible in both my Windows and my Linux box, but I noticed that there is less leading space on the pdf generated under Linux, and this is what I believe might have been causing my problem. I do appreciate any help on this matter. RC Post edited by: rcracel, at: 2008/03/28 15:06 Post edited by: rcracel, at: 2008/03/28 15:21 Link to comment Share on other sites More sharing options...
nazly Posted March 28, 2008 Share Posted March 28, 2008 rcracel wrote: I would like start by apologize that I will not be able to provide any samples of the problem I am experiencing due to the highly confidential data that I work with. I could try to make a mock up jrxml file to simulate this, but maybe someone else has experienced this and might have a quick easy solution.This is a very large project and I have been trying to track this down for quite a while and I believe I just figured out why the text is actually being dropped. I will try to elaborate on that a little, but let me know if you need more details.I have a multi page report, with multiple long text fields. Sometimes (rarely) the last couple of words on a text dropped depending on the length of the text. By the length of the text I mean an exact number of words (more accurately characters) and not necessarily the length of the text. I have checked my fonts and I know the font I am using is present and accessible in both my Windows and my Linux box, but I noticed that there is less leading space on the pdf generated under Linux, and this is what I believe might have been causing my problem.I do appreciate any help on this matter.RCPost edited by: rcracel, at: 2008/03/28 15:06 I have exact same problem! Link to comment Share on other sites More sharing options...
greylimbo Posted April 1, 2008 Share Posted April 1, 2008 I have also noticed this bug? Im using ttf fonts with my Pdf generation. Depending on the font(which leads me to suspect this maybe a ttf font specific problem), an exact number of characters is ommited from the large textfields. This varies according to the font used. Link to comment Share on other sites More sharing options...
lucianc Posted April 2, 2008 Share Posted April 2, 2008 I assume that everyone has read this FAQ. If PDF text gets truncated in a case which doesn't match any of the ones listed in the FAQ, I'm afraid we cannot guess what the cause is unless a reproducible test case is provided. Alternatively, you can debug the application yourself (JasperReports is open source for a reason) and determine what exactly happens. Regards,Lucian Link to comment Share on other sites More sharing options...
greylimbo Posted April 8, 2008 Share Posted April 8, 2008 Sorry for the delay, but here is the test case. I have tried to debug, and found JRPdfExporter bombs on "phrase.add(chunk);" line 1629 in "protected Phrase getPhrase(JRStyledText styledText, JRPrintText textElement)" and the exception thrown is "java.lang.ClassNotFoundException: com/lowagie/text/rtf/RtfBasicElement" it bombs when I try step into "phrase.add(chunk);" I have included a jrxml referencing a .ttf font that works "StatementCurrentSRFont1.jrxml" and the one that bombs "StatementCurrentSRFont2.jrxml" and a test xmldatasource that I am using. "StatementCurrentSRFont2.jrxml" is the jrxml that references "Verdana Bold Italic.ttf" and is the one that truncates the font. Thanks again. [file name=StatementCurrentSRFont1.jrxml size=2903] Link to comment Share on other sites More sharing options...
greylimbo Posted April 8, 2008 Share Posted April 8, 2008 Here is the jrxml that truncates the text [file name=StatementCurrentSRFont2.jrxml size=2911] Link to comment Share on other sites More sharing options...
greylimbo Posted April 8, 2008 Share Posted April 8, 2008 and here is the xml data [file name=statementInputData.xml size=2916] Link to comment Share on other sites More sharing options...
greylimbo Posted April 8, 2008 Share Posted April 8, 2008 Tahoma Bold.ttf and Verdana Bold Italic.ttf Post edited by: greylimbo, at: 2008/04/08 14:26 Link to comment Share on other sites More sharing options...
lucianc Posted April 8, 2008 Share Posted April 8, 2008 I see the following line in the second JRXML (there is something similar in the first JRXML as well, which only works correctly by luck): Code: [/code] Please read again this FAQ. As explained in the FAQ, the Java and PDF fonts needs to match. As you do not specify any fontName attribute, the default Java font will be used for your text field, and this font does not match the PDF font. If the Verdana font is available for your JVM, try the following: Code: Regards,Lucian 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