У меня проблема с webView и pdf ..
Когда я загружаю PDF-файл размером 10 МБ.
файл загружается много времени, и мой Pdf также плохо прокручивается ...
Может кто-нибудь сказать мне, в чем может быть проблема?
вот код ...
if ([resource.resource_type isEqualToString:@"pdf"] ) {
tempStr = [NSString stringWithFormat:@"%@.pdf",resource.resource_link];
type = [NSString stringWithFormat:@"pdf"];
}
else {
tempStr = [NSString stringWithFormat:@"%@.jpg",resource.resource_link];
type = [NSString stringWithFormat:@"jpg"];
}
NSArray *myArray = [tempStr componentsSeparatedByString:@"."];
NSString *path = [[NSBundle mainBundle] pathForResource:[myArray objectAtIndex:0] ofType:[myArray objectAtIndex:1]];
NSLog(@"array elemt :%@", [myArray objectAtIndex:0]);
NSLog(@"array elemt 1 :%@", [myArray objectAtIndex:1]);
NSLog(@"path is :%@",path);
if (isFirstTime) {
NSURL *targetURL = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[docWebView loadRequest:request];
isFirstTime = NO;
}
if(isLandscape == NO){
docWebView.frame = CGRectMake(0.0, 44.0, 768.0, 960.0);
}
else {
docWebView.frame = CGRectMake(0.0, 44.0, 1024.0, 700.0);
}
[self.view addSubview:docWebView];
[self.view bringSubviewToFront:activity];