Using PDF in iPad
Posted
by RVN
on Stack Overflow
See other posts from Stack Overflow
or by RVN
Published on 2010-04-10T10:13:33Z
Indexed on
2010/04/12
0:23 UTC
Read the original article
Hit count: 661
Has Anyone tried using PDF in iPad Application, using CGPDf functions. I have used this in iPhone and it works perfectly , but when i use the same code in iPad , the Page are Shrunk in size, after a try outs i set the Scale as follows
CGContextScaleCTM(context,1.85, -1.80);
This time the it fits the screen perfectly , but that was just a trial and error , why does it not fit the screen as in iPhone, i have set the view size correctly too.
Anyone having a clue about it please let me know.
and also this is my drawRect method where i am drawing the 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);
}
Thanks
© Stack Overflow or respective owner