I am having an issue regarding rotation of a pdf document in ipad. Have tried a lot using the following code, please have a look at it:
-(void) MyDrawPDFPageInRect:(CGContextRef)context :(CGPDFPageRef)page :(CGPDFBox)box :(CGRect)rect :(int)rotation :(bool)preserveAspectRatio
{
CGAffineTransform m;
m = CGPDFPageGetDrawingTransform (page, box, rect, rotation, preserveAspectRatio);
CGContextSaveGState (context);
CGContextConcatCTM (context, m);
CGRect pageframe = CGPDFPageGetBoxRect (page, box);
CGContextClipToRect (context,pageframe);
CGContextDrawPDFPage (context, page);
CGContextRestoreGState (context);
}
The code above is rotating the pdf but pdf size goes on diminishing with further rotation.
I think there is some problem in my code. So please give me some solution as i need to submit this app ASAP.
Regards
Thanks in advance.
CGRect mediaBox = CGPDFPageGetCropBox(page, kCGPDFCropBox)
The above thing needs to be rotated.
Thanks anyways…