Caijing_iPadAppDelegate *applicationDelegate = (Caijing_iPadAppDelegate *) [UIApplication sharedApplication].delegate;
Page *page = [article.pages objectAtIndex:0];
NSString *pageFile = page.landscapePage;
NSString *imagePath = [[applicationDelegate.articleDataManager.userIssue issuePath]stringByAppendingString:pageFile];
UIImage *image = [UIImage imageWithContentsOfFile:imagePath];
CGSize size = CGSizeMake(600, 600);
CGImageRef temp = CGImageCreateWithImageInRect(image.CGImage, CGRectMake(0, 0, 500, 500));
image = [UIImage imageWithCGImage:temp];
// UIGraphicsBeginImageContext(size);
// [image drawInRect:CGRectMake(0, 0, 500, 500)];
// UIImage *changedImage = UIGraphicsGetImageFromCurrentImageContext();
// UIGraphicsEndPDFContext();
NSData *data = UIImageJPEGRepresentation(image, 1.0);
//NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *path = [NSHomeDirectory() stringByAppendingString:@"/tmp/1.jpg"];
[data writeToFile:path atomically:NO];