Hybrid----u use Iwebview for PDF and other documents

Source: Internet
Author: User

App if you need to display PDF, Word file, at this time there is no other control, more suitable than UIWebView, which is highly abstract technical details, can be very easy to adopt

UIWebView Open File Type list

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvehvuew4=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70 /gravity/center ">


(Requires iOS3.0 system above)

You can see Excel, PPT, PDF, and word open.

Click to download the demo that opens the PDF

Add UIWebView to the interface. Gets the source file path. Open File

    NSString *path = [[NSBundle mainbundle] pathforresource:@ "Swift" oftype:@ "PDF"];    Nsurl *url = [Nsurl Fileurlwithpath:path];    Nsurlrequest *re = [Nsurlrequest requestwithurl:url];    [_webview Loadrequest:re];


Effect:


Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.

Hybrid----u use Iwebview for PDF and other documents

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.