in Education by
I have a UIWebview that loads a PDF with NSURLRequest. It will load the PDF, but if the pdf is too large the app crashes. I don't receive a memory warning. Is there a way to get the size of the PDF before I download it? Here is how I am loading it: NSURLRequest *currentRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:myUrlString]]; JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I think you should try to user NSURLMutableRequest instead in case of downloading large file so you can obtain multi-part downloading. You can also use the method expectedContentLength of NSURLResponse to know the file length. Here is an example : - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse*)response { NSLog (@"%d", [response expectedContentLength]); } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { if (self.currentDownloadedFile) { [self.currentDownloadedFile seekToEndOfFile]; [self.currentDownloadedFile writeData:data]; } } - (void)connectionDidFinishLoading:(NSURLConnection*)connection { // Close the file here } And force UIWebView open that downloaded file instead of downloading from un URL.

Related questions

0 votes
    I have an xlsx file with 4 Sheets. Using the code below I am able to export the first sheet only ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    If my post duplicated, please give me references. because i failed finding post that appropriate from my ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I have a pdf template file that contains one form field. I want to fill out and flatten this form ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    How do I "flatten" a PDF-form? I have a PDF form which needs to be filled. I have a simple ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    Consider the following SVG: The intended effect of the shape-rendering="crispEdges" annotation is to prevent ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I'm searching best way to fill pre-made pdf with forms with database data and "flatten" it. For ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 22, 2022 in Education by JackTerrance
0 votes
    Convert a .doc or .pdf to an image and display a thumbnail in Ruby? Does anyone know how to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    Convert a .doc or .pdf to an image and display a thumbnail in Ruby? Does anyone know how to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    Convert a .doc or .pdf to an image and display a thumbnail in Ruby? Does anyone know how to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 24, 2022 in Education by JackTerrance
0 votes
    I've inherited a legacy application that is supposed to grab an on the fly pdf from a reporting services ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am creating an Android app that will download and cache PDF files (the files are for issues of ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I'm very pleased with the various HTML templates available for phpDocs. I was wondering about additional PDF ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which page directive should be used in JSP to generate a PDF page? (a) contentType (b) generatePdf (c) typePDF (d ... JSP & API of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Which of the following is the symbol of standard normal PDF? (a) φ (b) # (c) & (d) * I had been ... & Neural Networks of R Programming Select the correct answer from above options...
asked Feb 11, 2022 in Education by JackTerrance
...