Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds! #30

Open
arvinzhao001 opened this issue Sep 2, 2022 · 0 comments
Open

Comments

@arvinzhao001
Copy link

arvinzhao001 commented Sep 2, 2022

Hi,
When I compare two pdf file using the PDFUtil, I encountered the following exception:

java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
at sun.awt.image.IntegerInterleavedRaster.getDataElements(IntegerInterleavedRaster.java:219)
at java.awt.image.BufferedImage.getRGB(BufferedImage.java:986)
at com.testautomationguru.utility.ImageUtil.compareAndHighlight(ImageUtil.java:20)
at com.testautomationguru.utility.PDFUtil.convertToImageAndCompare(PDFUtil.java:479)
at com.testautomationguru.utility.PDFUtil.comparePdfByImage(PDFUtil.java:450)
at com.testautomationguru.utility.PDFUtil.comparePdfFiles(PDFUtil.java:311)
at com.testautomationguru.utility.PDFUtil.compare(PDFUtil.java:271)
at com.sls.awb.PdfDiff2.main(PdfDiff2.java:28)

Would you please help to see what the problem is?Thank you

My Java Code:

package com.sls.awb;
import java.io.IOException;
import com.testautomationguru.utility.CompareMode;
import com.testautomationguru.utility.PDFUtil;

public class PdfDiff2 {
    public static void main(String[] args) throws IOException {
        PDFUtil pdfUtil = new PDFUtil();
        pdfUtil.setCompareMode(CompareMode.VISUAL_MODE);

        boolean same = pdfUtil.compare(args[0], args[1]);

        if (same) {
            System.out.println("same");
        } else {
            System.out.println("diff");
        }
    }
}

The two PDFS used for comparison can be viewed in the attachment
test-v1.pdf
test-v2.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant