Category: | Bug report |
Priority: | High |
Status: | New |
Project: | Severity: | Major |
Resolution: | Open |
|
Component: | Reproducibility: | Always |
Assigned to: |
Hello,
I think the new property "net.sf.jasperreports.legacy.text.measuring" doesn't work correctly. All of my text fields in the PDF export (except the top one) are each shifted by one more pixel. The last text field is then shifted by several text fields in total. Setting the property to "true" or "false" makes no difference. But I need the PDF export just like in version 6.18.1. I this a JasperReports bug?
The 6.20.5 release notes talk about "net.sf.jasperreports.export.pdf.legacy.text.measuring" to take advantage of the "legacy" state, but the code uses "net.sf.jasperreports. export.pdf.legacy.text.measuring.fix". But regardless of whether the flag is set to "true" or "false", the PDF eport always differs (same) from version 6.18.1.
Thank you.
libero
11 Comments:
Do you have a (self contained) report to reproduce the problem you're experiencing?
Regards,
Lucian
Hello Lucian,
thank you for the fast feedback.
I could provide you with two JasperPrint. Once with version 6.18.1 and once with version 6.20.5.
You can then set the flag once to "true" and once to "false" in version 6.20.5 and carry out a PDF export and it shouldn't make any difference for both versions.
However, the PDF export should differ from version 6.18.1 by 1 pixel per text field.
However, I still have to prepare the reports because they contain sensitive data. As soon as they are ready I will upload them here.
Thank you.
Hello,
I uploaded two JasperPrints. If you look at the JasperPrints, you can see that the texts in the new version are shifted from the line TEXT (y=278) compared to the old version TEXT (y=279). From here on, all text fields (JRTemplatePrintText) are shifted by 1 pixel each until the difference in the new version on TEXT (y=751) compared to the old version TEXT (y=731) is summed up.
The best way to see what I mean is to look at the two JasperPrints in the JRViewer. :-)
So the problem already occurs when I create the JasperPrints and not only when executing the PDF export. However, nothing was changed in the reports.
I noticed something else. (see png files)
In the old JasperReport (V6.18.1) the height of the text elements was "18" and in the new JasperReport (V6.20.5) the height is suddenly "19".
However, the reports have not changed. The whole thing is very strange.
Here is some more information:
If I set the following properties in jasperreports.properties, the report in V6.20.5 looks like it did in V6.18.1:
net.sf.jasperreports.default.line.spacing.size=-1
net.sf.jasperreports.default.spacing.before=-1
net.sf.jasperreports.default.spacing.after=-1
But that would probably only be a workaround.
Thx.
Hello,
could the case be recreated?
How is the bug rated?
Thx.
Looking at JasperPrint objects is not the best way to investigate the problem, ideally we would start with the report JRXML and look into how it generates the JasperPrint objects.
Can you attach the JRXML of the report that you used?
Also I see that the report uses a font named rewe_arial. Is that a font extension that you created? If so, can you attach the font extension jar as well?
Regards,
Lucian
Hello,
it is really very hard to give you the jrxml file. Everything is built dynamically and different jrxml files are used. You also need the generator to load the files and link them together using different IDs. I'm afraid it won't be possible to recreate the process using the jrxml files. Unfortunately, I can only provide you with the results as jasperPrint in both versions.
Regards,
libero
Hello,
how can we move forward at this point?
Thx.
I can attempt to reproduce the problem with a report of my own but the chances of success are not as good. Can you share the font extension jar used for your report?
Regards,
Lucian