Very short snippet: UIWebView, view PDF files, and internal

The object UIWebView can be used for the display of numerous files. For example you can use it to display - as well as QuickTime movies or YouTube - PDF documents or HTML files into our own code.

1
2
3
4
[WebView loadRequest:
requestWithURL : [ NSURLRequest requestWithURL:
fileURLWithPath : [ NSURL fileURLWithPath:
mainBundle ] pathForResource : @ "documento" ofType : @ "pdf" ] isDirectory : NO ] ] ] ; [[ NSBundle mainBundle] pathForResource: @ "document" oftype: @ "pdf"] isDirectory: NO]]];

Or:

1
2
3
4
[WebView loadRequest:
requestWithURL : [ NSURLRequest requestWithURL:
fileURLWithPath : [ NSURL fileURLWithPath:
mainBundle ] pathForResource : @ "documento" ofType : @ "html" ] isDirectory : NO ] ] ] ; [[ NSBundle mainBundle] pathForResource: @ "document" oftype: @ "html"] isDirectory: NO]]];

In viewing PDF files suggest you add in the settings of the UIWebView :

1
YES ] ; [WebView setScalesPageToFit: YES];

There are no comments for this post

Leave a comment

TAG XHTML PERMITS: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> CODE ENTRY:
 <pre></pre> // blocco generico <code></code> // blocco generico [cc_actionscript][/cc_actionscript] // Actionscript [cc_actionscript3][/cc_actionscript3] // Actionscript 3 [cc_css][/cc_css] // CSS Style Sheet [cc_html][/cc_html] // HTML [cc_js][/cc_js] // Javascript [cc_objc][/cc_objc] // Objective-C [cc_php][/cc_objc] // PHP [cc_sql][/cc_sql] // SQL