Using the crop box is something that I have found that I need, and was not implemented. Here is a basic implementation. To use it one would do the following:
I still have a one question about the implementation though. As I was testing the patch, I was testing to see if I needed to modify the loop that goes through and looks for /MediaBox entries to find the page size. Initially I thought that I would have to, because we are looking for /CropBox entries, and they should have priority over /MediaBox entries. But upon testing I couldn't see it making any difference. I even did this after right after the end of the loop:
And it didn't make any difference in the final output image.
So if this loop does need to be changed, it would be nice if someone could clarify what it is being used for (It only gets one size where each page could be a different size, and it doesn't necessary get the largest size either). Also it seems to me like it would need to changed to be page aware somehow, because the /CropBox entries would need to be chosen for pages that have them, but the /MediaBox entries otherwise.
Log in to post a comment.