Note that there are some explanatory texts on larger screens.

plurals
  1. POUIWebView shows preveously loaded page
    primarykey
    data
    text
    <p>In my app a web view is shown inside each cell of a table view. To increase the response I we decided to save web page as images. So I made a web view which is not visible and loaded each page one by one and created the image of the page on </p> <pre><code>- (void)webViewDidFinishLoad:(UIWebView *)webView </code></pre> <p>The image is created, but even images are missing and odd images are created twice. That is if I am creating four images say image1, image2, image3, image4 . The first and second image are the same image2 will be missing then third and fourth are same and image4 will be missing.</p> <p>Does anyone have any idea what's happening? How can I get all images? </p> <p>EDIT: code for saving image </p> <pre><code> NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDir = [documentPaths objectAtIndex:0]; CGSize pageSize = webView.frame.size; UIGraphicsBeginImageContext(pageSize); CGContextRef resizedContext = UIGraphicsGetCurrentContext(); [[webView layer] renderInContext:resizedContext]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); NSData* imageData = UIImageJPEGRepresentation(image, 1.0); NSString * filName; filName=[NSString stringWithFormat:@"%@_Potrait_%d.jpg",[currentSctionItem. titleName stringByReplacingOccurrencesOfString:@" " withString:@"_"],fileSavingAtIndex]; NSString * filePath = [documentsDir stringByAppendingPathComponent:filName]; [imageData writeToFile:filePath atomically:NO]; NSLog(@"File created At path:%@",filePath); fileSavingAtIndex++; if (fileSavingAtIndex&gt;=currentSctionItem.numberOfPagesLandscape) { //stop } else{ [webView loadHTMLString:[currentSctionItem potaraitHtmlAtThePage:fileSavingAtIndex] baseURL:baseURL]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload