I am trying to render pdf in landscape using this function:
Code:
- (void) renderPageAtIndex:(NSUInteger)index inContext:(CGContextRef)ctx {
CGPDFPageRef page = CGPDFDocumentGetPage(pdf, index + 1);
CGContextTranslateCTM(ctx, 0, self.view.bounds.size.height);
CGContextScaleCTM(ctx, 1.0, -1.0);
// CGPDFPageRef page = CGPDFDocumentGetPage(pdf, currentPage);
CGContextSaveGState(ctx);
CGRect box = CGPDFPageGetBoxRect(page, kCGPDFMediaBox);
CGContextScaleCTM(ctx, self.view.bounds.size.width/box.size.width, self.view.bounds.size.height/box.size.height);
CGContextDrawPDFPage(ctx, page);
CGContextRestoreGState(ctx);
}
But my pdf is upside down even words in pdf.
What to do if i want fix this ?