Display pdf from the weburl iphone sdk

前端 未结 1 1577
予麋鹿
予麋鹿 2021-01-28 08:35

I am working on one project I want to display the pdf which is on the website, I have the url of the pdf any idea how I can do it. Also I want to create a thumbnail of the pdf w

1条回答
  •  有刺的猬
    2021-01-28 09:25

    you could display a pdf in your device.

    Passing the url to UIWebView directly.

    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 360, 420)];
    
    NSURL *targetURL = [NSURL URLWithString:@"http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/UIWebView_Class.pdf"];
    NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
    [webView loadRequest:request];
    
    [self.view addSubview:webView];
    [webView release];
    

    0 讨论(0)
提交回复
热议问题