我是Objective-c iPhone编程的新手.我有一个应用程序,我在UIWebView中成功显示PDF,但现在我想创建我的PDF的缩略图.我的PDF存储在我的资源文件夹中.
所以请给我一些代码,说明如何显示我的PDF缩略图.我的代码用于显示PDF是按钮功能:
-(void)show:(id)sender {
pdfView.autoresizesSubviews = NO;
pdfView.scalesPageToFit=YES;
pdfView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
[pdfView setDelegate:self];
NSString *path = [[NSBundle mainBundle] pathForResource:@"com" ofType:@"pdf"];
NSLog(@"Path of res is%@",path);
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[pdfView loadRequest:request];
}
Run Code Online (Sandbox Code Playgroud)