tags:

views:

84

answers:

2

I have problem with quartz 2d to draw a pdf, I have it up and running fine

but I am not so sure how to progress to the next page

Here's the code

-(void)drawInContext:(CGContextRef)context{

     CGContextTranslateCTM(context, 0.0, self.bounds.size.height);
     CGContextScaleCTM(context, 1.0, -1.0);

     CGPDFPageRef page = CGPDFDocumentGetPage(pdf, 1);
     CGContextSaveGState(context);

     CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(page, kCGPDFCropBox, self.bounds, 0, true);

     CGContextConcatCTM(context, pdfTransform);

     CGContextDrawPDFPage(context, page);
     CGContextRestoreGState(context);
}

I know that I can change 1 to x for to get the page but how do i redraw the frame??

CGPDFPageRef page = CGPDFDocumentGetPage(pdf, 1);
A: 

To make view redraw call

[view setNeedsDisplay];
Vladimir
A: 

Thanks it works :)

Suwitcha Sugthana