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 8333701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:07:12+00:00 2026-06-09T03:07:12+00:00

I have some PDF formate document in subfolder of Resourse folder in my application.i

  • 0

enter image description here

I have some PDF formate document in subfolder of Resourse folder in my application.i have try to read these document like this way.here is my code.

   NSString *path = [[NSBundle mainBundle] pathForResource:chapter ofType:@"pdf"];
   NSURL *targetURL = [NSURL fileURLWithPath:path];
   NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
   [[webView scrollView] setContentOffset:CGPointMake(0,500) animated:YES];
   [webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"window.scrollTo(0.0, 50.0)"]];
   [webView loadRequest:request];
   [self.view addSubview:webView];
   [webView release];

In this code “path” Return Nill value,when i check in console.but when i check the string “chapter” which store my desire pdf document name ,Always it have one of the pdf document name.In Console when my program is crash it show some thing like this.

    Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 
'-[UIWebView scrollView]: unrecognized selector sent to instance 0x6587d20'

Any help will be appriated.

  • 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-09T03:07:13+00:00Added an answer on June 9, 2026 at 3:07 am

    Are you check out your pdf file in your project?

    enter image description here

    I test a following code. no problem.

    please check your chapter.pdf file in your project. the point is relative path.

    Must be case sensitive. “Chapter” / “chapter” is not equalString.

    NSLog(@"path:%@",[[NSBundle mainBundle] pathForResource:@"chapter" ofType:@"pdf"]);
    
    
    console:
        /var/mobile/Applications/72AFA069-D83E-469A-A687-AEAFDB0B4D97/TableViewTest.app/chapter.pdf
    

    NSLog(@"path:%@",[[NSBundle mainBundle] pathForResource:@"Chapter" ofType:@"pdf"]);
    
    
    console:
        (null)
    

    self.myWebView = [[[UIWebView alloc] initWithFrame:webFrame] autorelease];
    self.myWebView.backgroundColor = [UIColor whiteColor];
    self.myWebView.scalesPageToFit = YES;
    self.myWebView.delegate = self;
    [self.view addSubview:self.myWebView];
    [self.myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"chapter" ofType:@"pdf"]]]];
    

    enter image description here


    In your project folder name will disappear in a actual iPhone bundle.
    You have created a folder called Resource-Common, but eventually disappears in NSBundle.

    enter image description here

    See the image below. Both are integrated. folder name in the project is only just visible folder in xcode.

    enter image description here

    If you want all pdf file list in NSBundle. try to following code.

    NSArray *pdfCollection = [[NSBundle mainBundle] pathsForResourcesOfType:@"pdf" inDirectory:nil];
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code to read from a pdf file. Is there a way
I have some PDF files in a public rails folder. I want to set
I have some pdf files located on a http server: Like: http://domain.com/files/file1.pdf http://domain.com/files/file1.pdf http://domain.com/files/file1.pdf
I have some pdf documents and I need to find a way to automate
I have some SVG files that I'd like to create a PDF with. For
I have been developing Android application, and I need to read PDF-files in my
I have some code like this: respond_to do |format| format.html { @all_activities = current_user.recent_activities(@size_per_page,params[:start],nil)
I have some VTK-files, which look like this: # vtk DataFile Version 1.0 Line
I have some images and pdf file on my server which I use in
I have ASP.NET page with an iframe on it for displaying some pdf reports

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.