07-06-2017, 02:16 AM
I use the MediaBox for the page dimensions. i believe I am setting the right value of the crop rectangle to pageWidth - 1 and the bottom value to pageHeight - 1 if you drag the cropping boxes all the way to the edges of the page. If you clear the cropping, I set it to 0,0,0,0, so that's how you can identify when no crop has been applied. During some of my processing, if I calculate that cropping was applied, I set pageWidth = width of the cropping box + 1, and pageHeight = height of the cropping box + 1, and verify that I haven't exceeded the raw page dimensions (otherwise I clamp).