How to handle different type of Pdf display boxes like media box, cropbox etc.. I am drawing pdf and page’s cropbox and media box are different so page is cutting. So any one have a clear idea how to take care or handle about this boxes while drawing a page.CGRect cropBoxRect = CGPDFPageGetBoxRect(drawPDFPageRef, kCGPDFCropBox);
CGRect mediaBoxRect = CGPDFPageGetBoxRect(drawPDFPageRef, kCGPDFMediaBox);
CGRect effectiveRect = CGRectIntersection(cropBoxRect, mediaBoxRect);
I am using above effective rect in drawing.and it creates issue.
Thanks in advance.
MediaBox is defines the physical page size, CropBox defines the visible page size. The size of the page you see in any viewer is given by the CropBox. These boxes are defined in terms of lower left and upper right corners [llx lly urx ury]. Usually the CropBox is contained in MediaBox, so the effectiveRect in your code should match the CropBox.
The MediaBox is mandatory, the CropBox is optional and when it is missing, its value matches the MediaBox.