Skip to main content

Posts

Showing posts with the label Thumbnail

ThumbNail of PDF

-( void )thumbnailOfPDF{     NSURL * pdfFileUrl = [ NSURL fileURLWithPath :[[ NSBundle mainBundle ] pathForResource : @"test" ofType : @"pdf" ]];     CGPDFDocumentRef pdf = CGPDFDocumentCreateWithURL (( CFURLRef ) CFBridgingRetain (pdfFileUrl));     CGPDFPageRef page;          CGRect aRect = CGRectMake ( 0 , 0 , 70 , 100 ); // thumbnail size     UIGraphicsBeginImageContext (aRect. size );     CGContextRef context = UIGraphicsGetCurrentContext ();     UIImage* thumbnailImage;               NSUInteger totalNum = CGPDFDocumentGetNumberOfPages (pdf);          [ self . thumbScrollView setContentSize : CGSizeMake ( self . thumbScrollView . frame . size . width , totalNum* 100 )];     for ( int i = 0 ; i < totalNum; i++ ) {               ...