views:

395

answers:

2

Haii...

How can we implement a pdf reader for iPad without usin UIWebView. It needs the option for adding gestures for changing the page with a hand touch. How does I can do that?. What are the classes that need to be implemented for the purpose. Give sample codes if possible.

                                                Thanking you

Sagar S. Kadookkunnan

Post 2---

Haiii guys... I got something like Quartz 2D programming guide for PDF Documents. But i can not identify where should i place the context of the pdf. Should i place it in a UIView?. Please reply me immediately.

Thanking you

Sagar S. Kadookkunnan

Refer : http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html#//apple_ref/doc/uid/TP30001066-CH214-TPXREF109

Help me I am just a beginner!!.....

+1  A: 

A CGPDFDocument consists of a series of pages. If you create a custom UIView with a CGPDFPageRef member, you can use it to draw the page.

@interface ExamplePDFPageView : UIView
    CGPDFPageRef page;
@end

@implementation ExamplePDFPageView
-(void) drawRect:(CGRect)inFrame {
    CGContextDrawPDFPage( UIGraphicsGetCurrentContext() , page );
}
@end

That is the basic building block from which you build a pdf reader. You could have the view own the whole document instead of just one page, but the drawing is done per page. I generally let some controller class own the document and assign pages to views.

For gestures, add a UISwipeGestureRecognizer or other gesture recognizer to the view.

drawnonward