小编Ing*_*gve的帖子

在iphone中创建pdf缩略图

我是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)

pdf iphone objective-c

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

iphone ×1

objective-c ×1

pdf ×1