Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8558121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:44:12+00:00 2026-06-11T15:44:12+00:00

Currently, I detect if the UIWebView load a pdf file by doing a check

  • 0

Currently, I detect if the UIWebView load a pdf file by doing a check on the current URL. Next I download the pdf file with ASIHTTPRequest library. The problem is that if the file is display in the UIWebView, is that it is already downloaded somewhere, so I download this file twice. How can I get this file load in my UIWebView ?

The purpose is to store this file loaded in my UIWebView in my Document directory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:44:13+00:00Added an answer on June 11, 2026 at 3:44 pm

    Here’s how you can download, read and store your pdf locally in iphone application, so that you don’t have to download regularly:

    First create UIWebView and include <<UIWebViewDelegate>>

      NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
      NSString *documentsPath = [paths objectAtIndex:0];
      NSString *filePath = [documentsPath stringByAppendingPathComponent:@"YourPDF.pdf"]; 
     if(![[NSFileManager defaultManager] fileExistsAtPath:filePath]){ // if file not present
               // download file , here "https://s3.amazonaws.com/hgjgj.pdf" = pdf downloading link
             NSData *pdfData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"https://s3.amazonaws.com/hgjgj.pdf"]];
                //Store the downloaded file  in documents directory as a NSData format
             [pdfData writeToFile:filePath atomically:YES];
        }
    
         NSURL *url = [NSURL fileURLWithPath:filePath];
         NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
         [yourWebView setUserInteractionEnabled:YES];
         [yourWebView setDelegate:self];
         yourWebView.scalesPageToFit = YES;
         [yourWebView loadRequest:requestObj];
    

    Or, if you simply want to read/load pdf from your Resource folder then simply do this :

         NSString*  filePath= [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"pdf"]];
        /// or you can even read docs file as : pathForResource:@"sample" ofType:@"docx"]
         NSURL *url = [NSURL fileURLWithPath:filePath];
         NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
         [yourWebView setUserInteractionEnabled:YES];
         [yourWebView setDelegate:self];
         yourWebView.scalesPageToFit = YES;
         [yourWebView loadRequest:requestObj];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a drag/drop list my problem being I'm trying to detect when
I'm currently writing a JSP-application with webservices. The problem is: I should detect the
Currently with WMI's Win32_Process, I seem unable to detect if a batch file is
Currently I'm using following PHP+JavaScript code to detect clients browser windows size $url=http://.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; if(isSet($_GET['w'])
I'm currently doing an application where I'm trying to detect touch-positions of the user.
I'm very new to WPF. I'm currently doing a code to detect joints coordinate
What is the currently best method to detect spam ? especially on mobile text
Is there a way to detect if the device I'm currently running on has
What I am currently trying to do is use the Face API to detect
How do you detect the current SCAN state and revert it after changing it?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.