Has anyone tried using PDF in an iPad application using the CGPDf features. I used it on the iPhone and it works fine, but when I use the same code on the iPad, the page is reduced in size, after trying out I set the scale as follows
CGContextScaleCTM(context,1.85, -1.80);
This time it is perfect for the screen, but it was just trial and error, why it is not suitable for the screen, as in the iPhone, I also set the size of the view correctly.
Anyone who knows about this, let me know.
and also this is my drawRect method, where I draw a PDF page
void drawRect:(CGRect)rect{ UIGraphicsBeginPDFPage(); CGContextRef context = UIGraphicsGetCurrentContext(); CGPDFPageRef page = CGPDFDocumentGetPage(pdf, pageNumber); CGContextSaveGState(context); CGContextTranslateCTM(context, 1.0, self.frame.size.height); CGContextScaleCTM(context,1.0, -1.0); CGContextDrawPDFPage(context, page); CGContextRestoreGState(context);
}
alt text http://www.freeimagehosting.net/uploads/6b8bb69bb9.png
thanks
source share