Hi Bruno, > You are assuming that class Rectangle has its own implementation > of the equals() method, which it hasn't. And even if you were able
Ah, sorry I was just hoping something similar would be possible, and writing pseudo-code. I noticed the height and width related methods, but it seemed more elegant to compare to the constants in PageSize, as they're already what I need. > to use the equals() method, then you would still have to check if > by chance you have a page in the LETTER format, but rotated. I was testing rotation elsewhere. In fact, I do have a rotated (landscape) page in my test document. However, there seems to be a discrepancy: System.out.println doc.getPageSize(): Rectangle: 612.0x792.0 (rot: 0 degrees) System.out.println doc.getPageRotation(): 90 And from the PDF: strings source_document.pdf |grep MediaBox <</Type/Page/MediaBox [0 0 612 792] strings source_document.pdf |grep Rotate /Rotate 90/Parent 3 0 R Why doesn't getPageSize indicate the page is rotated? Shouldn't it return 792x612, especially given your explanation above; if not, then I *could* compare with PageSize.LETTER because the raw paper size (612x792) is correct, although the orientation is not. > I think the safest thing to do would be to compare the > widths and heights (don't forget to deal with pages in > portrait vs. landscape orientation). Ok, I'll try this. Would it be possible to have equals() or the comparable interface in PageSize? Thanks for your help, Richard ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/