ios - UIWebview doesen't display PDF -


i have used code displaying pdf on webview.

webview=[[uiwebview alloc]initwithframe:cgrectmake(0, 0, 320, 480)]; nsstring *path = [[nsbundle mainbundle] pathforresource:@"fonts1" oftype:@"pdf"]; nslog(@"%@",path); nsurl *targeturl = [nsurl fileurlwithpath:path]; nsurlrequest *request = [nsurlrequest requestwithurl:targeturl]; [webview loadrequest:request]; webview.scalespagetofit=yes;  [self.view addsubview:webview]; 

pdf in bundle pdf correctly.

what wrong in code.

try below one

uiwebview *webview = [[uiwebview alloc] initwithframe:cgrectmake(10, 10, 200, 200)];  nsstring *path = [[nsbundle mainbundle] pathforresource:@"document" oftype:@"pdf"]; nsurl *targeturl = [nsurl fileurlwithpath:path]; nsurlrequest *request = [nsurlrequest requestwithurl:targeturl]; [webview loadrequest:request];  [self.view addsubview:webview]; [webview release]; 

Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -