Skip to content

1 pixel difference in Y axis #124

Answered by gastendonk
gastendonk asked this question in Q&A
Discussion options

You must be logged in to vote

This is the cause of the problem and there will be no fix for it: https://bugs.openjdk.org/browse/JDK-8215290

So that the transition from Java 8 to Java 17 still works, I modified the jasperPrint object before the PDF file is created and pdfcompare is executed.

The leadingOffset values of the JRTemplatePrintText class differ for a JasperReport created with Java 8 and one with Java 17.

private void fake(JasperPrint jasperPrint) {
    for (JRPrintPage page : jasperPrint.getPages()) {
        fake2(page.getElements());
    }
}
private void fake2(List<JRPrintElement> list) {
    for (JRPrintElement e : list) {
        if (e instanceof JRTemplatePrintText) {
            JRTemplatePrintText tex…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@finsterwalder
Comment options

Answer selected by gastendonk
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants