Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

PDF Viewer Tutorial

245

Replies

  • hardikapatelhardikapatel Posts: 45Registered Users
    edited December 2009
    rmonson wrote: »
    This works well but you have to remove the dot (".") from the file type or it doesn't work. so the "ofType" parameter should be as follows:

    ofType:@pdf

    Notice the dot is missing.


    Hello
    I m also trying the same thing.But I instead of pdf file I am using xls file.but I am not able to display the content of the file.Do I have to make those changes in the interface builder.I am using the following code.

    NSString *myFilePath = [[NSBundle mainBundle]pathForResource:@help ofType:@xls];
    NSURL *xlsUrl = [NSURL URLWithString:myFilePath];

    and I am using xls file as a resource.
    Thanks & Regards<br />
    Hardik.A.Patel.
  • hardikapatelhardikapatel Posts: 45Registered Users
    edited December 2009
    sukumar_77 wrote: »
    Thanks Daniel for your great work.

    The same approach may be useful to read Microsoft Office Documents i.e. Word, Excel and PPT, if required.

    Hello
    Can YOU please guide me how to read the xls file in my iphone application.
    I tired the given above but I cant read the xls file and I am using this xls file as a RESOURCE.If possible for you can you give me steps to do the same.
    If you have a sample code then can u please mail it to me at hardikpatel1987.007@gmail.com.
    Thanks in advance.
    Thanks & Regards<br />
    Hardik.A.Patel.
  • hardikapatelhardikapatel Posts: 45Registered Users
    edited December 2009
    hello
    can u also send me the code.
    my email is hardikpatel1987.007@gmail.com
    Thanks & Regards<br />
    Hardik.A.Patel.
  • hardikapatelhardikapatel Posts: 45Registered Users
    edited December 2009
    danielb21 wrote: »
    Hey everyone,

    I've been extremely busy and haven't been able to reply till just now. I'm creating a simple project for this right now and will send to all that have PM'ed me.

    Thanks!
    Dan

    Sir please forward me the sample code of reading a PDF file in an iphone application.If possible also guide me how to read a xls file in an iphone application.
    thank you
    Thanks & Regards<br />
    Hardik.A.Patel.
  • hardikapatelhardikapatel Posts: 45Registered Users
    edited December 2009
    sukumar_77 wrote: »
    Thanks Daniel for your great work.

    The same approach may be useful to read Microsoft Office Documents i.e. Word, Excel and PPT, if required.

    Hello..
    I cant view the pdf file.
    I have used the same code which was give by you.i.e

    NSString *pdfPath = [[NSBundle mainBundle] pathForResource:@MyFilePDF ofType:@pdf];
    NSURL *pdfUrl = [NSURL URLWithString : pdfPath];

    I am using MyFilePDF as a resource file.
    I want to use excel file in my iphone application can u guide me please
    I have used the following code..

    NSString *xlsPath = [[NSBundle mainBundle] pathForResource:@MyFileXls ofType:@xls];
    NSURL *xlsUrl = [NSURL URLWithString:xlsPath];

    I am using MyFileXls as a Resource.

    It is giving an error call bad execution.Can you tell me what mistake I am making.If you have a sample code then please give it to me or mail me at hardikpatel1987.007@gmail.com
    Thanks & Regards<br />
    Hardik.A.Patel.
  • krunal247krunal247 Posts: 2New Users
    edited December 2009
    I also want the same code. If you are willing to share with me my mail id is krunal247@gmail.com
  • iphonedeveloper11iphonedeveloper11 Posts: 30Registered Users
    edited December 2009
    Awesome tutorial. Thanks. Im going to use this for a ebook type project, greatly appreciated!
  • wanderingwandering Posts: 1New Users
    edited December 2009
    danielb21 wrote: »
    Hey everyone,

    I've been extremely busy and haven't been able to reply till just now. I'm creating a simple project for this right now and will send to all that have PM'ed me.

    Thanks!
    Dan

    Hi there, can you send me a copy please?
    wanderingz328@yahoo.co.nz
    Thanks
  • MsinghMsingh Posts: 4New Users
    edited December 2009
    Ok, so, I finally got that sorted out, but I think there's something wrong with this code
    // Save data if appropriate
    	// Create an instance of PDFViewController
    	PDFViewController *controller = [[PDFViewController alloc] initWithNibName:@PDFView bundle:nil];
    	// Get the path to our documents directory
    	NSArray *documentPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    	// This should be our documents directory
    	NSString *saveDirectory = [documentPath objectAtIndex:0];
    	// Our PDF is named 'Example.pdf'
    	NSString *saveFileName = @Example.pdf;
    	// Create the full path using our saveDirectory and saveFileName
    	NSString *finalPath = [saveDirectory stringByAppendingPathComponent:saveFileName];
    	// Set the pdfUrl to our finalPath
    	controller.pdfUrl = [NSURL fileURLWithPath:finalPath];
    	// Push 'controller'
    	[self.navigationController pushViewController:controller animated:YES];
    	// Release 'controller'
        [controller release];
    

    the application gets an error, I think I'm putting it in the right spot, AppDelegate, under applicationDidFinishLaunching..... Please Help, I'm really stuck here, you could even just send a working project of this so I can figure out myself. PLEASE HELP ME!!
    (email is akaldifauj@gmail.com)
    Thanks in advance,
    Msingh
  • limocharlottelimocharlotte Posts: 1New Users
    edited December 2009
    Hi... it looks good while open pdf docs but what if i want to open excel or word documents? any code or suggestions for this?
  • MsinghMsingh Posts: 4New Users
    edited December 2009
    Please help me. Can anybody just send me the finished product? Email is akaldifauj@gmail.com PLEASE HELP I don't want to have to pay $100 again next year PLEASE!!!
  • damian_sagedamian_sage Posts: 5New Users
    edited January 2010
    Hey cool man. I was lookin to make my own pdf viewer a few months ago, but my motivation kinda fizzled out... But this tutorial looks like a good place to start.
    Thanks. ^_^
  • muzammilmuzammil Posts: 12Registered Users
    edited February 2010
    Hi,
    Can anyone send me the code.....
    I am also looking for how to edit pdf files by using objectice C in XCode.
    If anyone have idea regarding this, Plz share.
    my mail id is muz.aazmi@gmail.com

    Thanx in advance.
  • dmemariandmemarian Posts: 1New Users
    edited February 2010
    I'd be grateful if anyone could send me the code as well. My email is dmemarian@me.com

    Many thanks!
  • ikitxikitx Posts: 6New Users
    edited February 2010
    My email is : kit@lucidus.com.hk
    Please send me the source code.
  • SjakelienSjakelien Posts: 2New Users Noob
    edited February 2010
    I would very much appreciate to receive a copy of the full project, too!
    My email address is sjakelien@yahoo.com
    Thanks
    Sjakelien
  • BustinStonesBustinStones Posts: 1New Users
    edited February 2010
    danielb21 wrote: »
    Hey everyone,

    I've been extremely busy and haven't been able to reply till just now. I'm creating a simple project for this right now and will send to all that have PM'ed me.

    Thanks!
    Dan

    Would love to get a copy of this project as well. jb7404@bellsouth.net

    Regards
  • outtoplayouttoplay Posts: 4New Users
    edited February 2010
    Hi All,

    Wow...just stumbled across this! Would really appreciate if someone could take a moment and email me Daniel's example project...outtoplay@gmail.com

    This would be terrific... What a great community here!

    Brendang
  • danielb21danielb21 Posts: 48Tutorial Authors, Registered Users
    edited February 2010
    Hey everyone,

    I've posted the project on github now because I can't keep up with all of the requests.

    You can find it here:
    danberry's PDF-Viewer at master - GitHub

    Thanks!
    Dan
  • tsfrockstsfrocks Posts: 21Registered Users
    edited February 2010
    danielb21 wrote: »
    Hey everyone,

    I've posted the project on github now because I can't keep up with all of the requests.

    You can find it here:
    danberry's PDF-Viewer at master - GitHub

    Thanks!
    Dan



    I have a WebView that displays a local pdf file. The file is 230 pages long and loads fine etc. I need a way for the user to jump to a specific page if I can. For instance if they look at the table of contents of the pdf and they want to jump to page 120, they can do it? Any ideas on getting this done?
  • k182k182 Posts: 56Registered Users
    edited February 2010
    hey

    thanks for the source code, I going to have a look at it.
  • iRJiRJ Posts: 1New Users
    edited February 2010
    tsfrocks wrote: »
    I have a WebView that displays a local pdf file. The file is 230 pages long and loads fine etc. I need a way for the user to jump to a specific page if I can. For instance if they look at the table of contents of the pdf and they want to jump to page 120, they can do it? Any ideas on getting this done?

    I am also looking to implement this, have you found a way to do this yet? Or does anyone else know?
  • tsansonetsansone Posts: 11Registered Users
    edited March 2010
    iRJ wrote: »
    I am also looking to implement this, have you found a way to do this yet? Or does anyone else know?

    Hi,

    This a great tutorial thanks. I am a beginner and had to download the finished project, but I did and it works.

    Now I need to find a way to add this to my own existing application. Does anyone know how I would set this up where if I click on a button it would then load the PDF?

    Any help would be appreciated.
  • jbourne08jbourne08 Posts: 16Registered Users
    edited March 2010
    Hi Dan
    I m trying to use the pdf viewer with web service. I want to use the pdf url returned by the webservice. Any suggestions how should i go about it
    thanks
    danielb21 wrote: »
    Hey everyone,

    I've posted the project on github now because I can't keep up with all of the requests.

    You can find it here:
    danberry's PDF-Viewer at master - GitHub

    Thanks!
    Dan
  • onemptyonempty Posts: 3New Users
    edited March 2010
    This is exactly what I am looking for. Can I have the app e-mailed to me so I can play with it. I am so new that I don't understand a lot of what is stated above. If I had the app I think I could add my PDF and get it working. I hope.

    jengel@mcg.edu

    Thanks
    John
Sign In or Register to comment.