I am using PdfBox to read the Xobjects in a pdf, the xobjects are of type Form, I noticed the lower left y and upper right y are of a wrong values, the illustrator/ pdf viewers are showing correct rendering
Here is my code to find the y coordinates
PDDocument document = PDDocument.load(new File("D:/temp/temp.pdf"));
PDResources pdResources = document.getPage(0).getResources();
Iterable<COSName> cosNames = pdResources.getXObjectNames();
for (COSName cosname : cosNames) {
PDXObject xobject = pdResources.getXObject(cosname);
COSStream stream = xobject.getCOSObject();
PDFormXObject pdxObjectForm = new PDFormXObject(stream);
System.out.println(pdxObjectForm.getBBox().getLowerLeftY());
System.out.println(pdxObjectForm.getBBox().getUpperRightY());
}
document.close();
// TODO: handle exception
}
The actual displayed results are: lower left y : -2494.4902 upper right y: -283.47314
However, the right value for lower left y from illustrator is: 2211
Now I understand that the top left is the 0,0, this is not the issue, the issue is that the value -2494 is out of the trimbox.
You can check the pdf link here: https://www.justbeamit.com/zxime