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

124

Replies

  • leecravenleecraven Posts: 27Registered Users
    edited October 2010
    Using this code the pdf enclosed in the download view's correctly, if I create a pdf of my own it displays incorrectly, like it's pre-zoomed in, how do we setup the app to show the pdf zoomed into the content already if that makes sense?
  • politespolites Posts: 2New Users
    edited October 2010
    DSA wrote: »
    Hey amigo check out page 2 there is a link for the code :)

    Dan great code I do have a question however,

    1)Can the white screen that precedes the loading of the PDF be eliminated by a sleep mode enabled splash screen?

    Thanks DSA!!!
  • eduard510eduard510 Posts: 14Registered Users
    edited October 2010
    I could view a pdf on my iphone, but if i want more than only view it.

    how can i change the scrolling page in a Horizontal way.
    Build an index
    How can i work with the Quartz framework, to complete all tasks of a PDF Viewer

    Thanks
  • timmy2006timmy2006 Posts: 1New Users
    edited October 2010
    I'd like to ask what should be changed if I want to make a testing app into iPhone so that the device can read a pdf file stored in my database. Is it just simply change the saveDirectory in PDFViewController.h or if there is any other changes. If possible, please contact me at timmychan2005@gmail.com goon gmail, thanks. if you are free could you please send me an example project of your pdf viewer in your tutorial
  • jctoddjctodd Posts: 8New Users
    edited November 2010
    Could someone please email me sample code as well? enfiron @ gmail dot com.

    Thanks a million!
  • CanDevCanDev Posts: 63Registered Users
    edited November 2010
    seriously people...stop asking for the code...just DL it from Github like it says on page 2
  • giribhushangiribhushan Posts: 2New Users
    edited January 2011
    Hi,
    i am getting warning can any one help me please....its urgent.

    i am getting warning in line 15. pushViewController

    warning: 'PDFViewController' may not respond to '-pushViewController:animated:'

    plz help.



    1.- (BOOL)application:(UIApplication *)application 2.didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    3. // Override point for customization after application launch.



    4. // Create an instance of PDFViewController
    5. PDFViewController *controller = [[PDFViewController alloc]
    6. initWithNibName:@PDFView bundle:nil];
    // Get the path to our documents directory
    7. NSArray *documentPath = 8.NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, 9.NSUserDomainMask, YES);
    // This should be our documents directory
    10. NSString *saveDirectory = [documentPath objectAtIndex:0];
    // Our PDF is named 'Example.pdf'
    11. NSString *saveFileName = @Example.pdf;
    // Create the full path using our saveDirectory and saveFileName
    12. NSString *finalPath = [saveDirectory 13.stringByAppendingPathComponent:saveFileName];
    // Set the pdfUrl to our finalPath
    14.controller.pdfUrl = [NSURL fileURLWithPath:finalPath];
    // Push 'controller'
    15. [self.navigationController pushViewController:controller animated:YES];


    // Release 'controller'
    16. [controller release];



    17. [window makeKeyAndVisible];

    18. return YES;
    19. }

    warning: 'PDFViewController' may not respond to '-pushViewController:animated:'
  • giribhushangiribhushan Posts: 2New Users
    edited January 2011
    Hi,
    i am getting warning can any one help me please....its urgent.

    i am getting warning in line 15. pushViewController

    warning: 'PDFViewController' may not respond to '-pushViewController:animated:'

    plz help.



    1.- (BOOL)application:(UIApplication *)application 2.didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    3. // Override point for customization after application launch.



    4. // Create an instance of PDFViewController
    5. PDFViewController *controller = [[PDFViewController alloc]
    6. initWithNibName:@PDFView bundle:nil];
    // Get the path to our documents directory
    7. NSArray *documentPath = 8.NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, 9.NSUserDomainMask, YES);
    // This should be our documents directory
    10. NSString *saveDirectory = [documentPath objectAtIndex:0];
    // Our PDF is named 'Example.pdf'
    11. NSString *saveFileName = @Example.pdf;
    // Create the full path using our saveDirectory and saveFileName
    12. NSString *finalPath = [saveDirectory 13.stringByAppendingPathComponent:saveFileName];
    // Set the pdfUrl to our finalPath
    14.controller.pdfUrl = [NSURL fileURLWithPath:finalPath];
    // Push 'controller'
    15. [self.navigationController pushViewController:controller animated:YES];


    // Release 'controller'
    16. [controller release];



    17. [window makeKeyAndVisible];

    18. return YES;
    19. }

    warning: 'PDFViewController' may not respond to '-pushViewController:animated:'
  • jNoxxjNoxx Posts: 491Registered Users
    edited January 2011
    Can u like please dont double post, and PLEASE FOR THE SAKE OF THIS FORUM, include Code tags, goddamnit.

    U probably tried to edit something where u have no idea off, and now it's messed up >.>
    u are doing a pushViewController on ur navigationController, did u delete the navigation? then it wont push the new view u want :/
  • eden_yapeden_yap Posts: 1New Users
    edited January 2011
    HI danielb,

    Can you pls send me the sample project ?

    My e-mail is eden_yap@live.com

    Thank you !

    eden
  • karrohitkarrohit Posts: 1New Users
    edited January 2011
    Great tutorial.. I need some line by line explanation because i'm new to this one.. And tell me when the drawlayer methos calls and explain internal activities of those.

    Thanks
  • ajay_458ajay_458 Posts: 3New Users
    edited January 2011
  • ajay_458ajay_458 Posts: 3New Users
    edited January 2011
    I'm just getting started at this and what I'm trying to do is to make a simple app where I can click on the icon and a pdf comes up that can be expanded etc. I have created a simple app and then used this tutorial and it's not getting any errors but my pdf isn't showing up. My pdf is a resource file. I have put the code above in a view controller in the loadView section. I have no idea if this is correct - I've tried several other things as well. Can someone tell me where the code above is supposed to go.

    Thanks!

    can you plese answer for the iphone - printing pdf in ipad - Stack Overflow question
  • Ankit1010Ankit1010 Posts: 9New Users
    edited February 2011
    Hi,

    Does anyone know how I can save the page I was on using before quitting, and load the PDF on that page when the app is restarted?
  • CynthiaBlue44CynthiaBlue44 Posts: 11Registered Users
    edited February 2011
    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

    Thanks for your tutorial and the download. It's much appreciated.
  • CynthiaBlue44CynthiaBlue44 Posts: 11Registered Users
    edited February 2011
    eduard510 wrote: »
    I could view a pdf on my iphone, but if i want more than only view it.

    how can i change the scrolling page in a Horizontal way.
    Build an index
    How can i work with the Quartz framework, to complete all tasks of a PDF Viewer

    Thanks

    Did anyone figure out how to read the PDF horizontally?

    Thanks again to the creator of this tutorial, your effort was very generous and much appreciated. I've learned a lot by working through it and reading through this post.

    Last night I was successful in getting it to work on the iPad. Now I'm looking forward to refining it. There seems to be a growing demand from clients to be able to read a PDF related to their product via a branded icon. For me, the next step will be finding out how to access the features of iBook within a branded PDF Viewer. I know that the address book features can be accessed so my reasoning is that it may also be possible to do the same with the iBook features.

    If anyone has found a way of accessing the iBook features via their own App, I would be very interested to know about it. If I work it out, I'll return to this post, and share it.

    Good luck everyone!
  • Ankit1010Ankit1010 Posts: 9New Users
    edited February 2011
    Did anyone figure out how to read the PDF horizontally?

    Thanks again to the creator of this tutorial, your effort was very generous and much appreciated. I've learned a lot by working through it and reading through this post.

    Last night I was successful in getting it to work on the iPad. Now I'm looking forward to refining it. There seems to be a growing demand from clients to be able to read a PDF related to their product via a branded icon. For me, the next step will be finding out how to access the features of iBook within a branded PDF Viewer. I know that the address book features can be accessed so my reasoning is that it may also be possible to do the same with the iBook features.

    If anyone has found a way of accessing the iBook features via their own App, I would be very interested to know about it. If I work it out, I'll return to this post, and share it.

    Good luck everyone!


    The problem is that the API for the features that iBooks uses is NOT public, which means there is simply no way to use the features that iBooks uses directly until Apple decides to make the API public.

    All we can do is piece together the features ourselves, and thats what I'm working on:
    Apple has a ZoomingPDFViewer example that lets you zoom in PDFs
    There are many tutorials and projects on the net describing app-store safe ways to obtain the page-flip animation.
    I've found a tutorial that teaches you how to search PDF's - Random Ideas

    Now I need to figure out how to find and highlight the words found in the PDF.
  • pvadheespvadhees Posts: 1New Users
    edited February 2011
    Hi, Any chance someone could forward the example project file on to me aswell??
    Many thanks! (Andrew @ Aderrington.co.uk)
    Andrew

    i think now u got project sample. if so plz send me on pvadhees@gmail.com

    Thanks in advance
  • DeepthiTDeepthiT Posts: 1New Users
    edited March 2011
    Hi Daniel,

    Thanks for your PDF creation and PDF Viewer tutorial.

    Could you please help me with this.

    I have a table with UIScrollView which will be populated with large amount of data from plist. I would like to generate pdf with all the content. How to make this possible?

    Currently I am doing image capture and using that image in pdf. But my Image capture doesn't hold all the contents of table.

    Thanks,
    Deepthi.
  • amitchauhanamitchauhan Posts: 28Registered Users @
    edited March 2011
    Can someone send me the this project source code please?

    amitkushvaha@gmail.com
  • psudheer28psudheer28 Posts: 22Registered Users
    edited April 2011
    Hi
    Thanks for the tutorial. It was really a detailed on.
    It would be great if you can send me the sample code too.
    My email id : psudheer@hotmail.com
  • makaflaymakaflay Posts: 2New Users
    edited May 2011
    // 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];


    where shall I write this code, at the delegate?
  • WilScottWilScott Posts: 5New Users
    edited May 2011
    Can someone send me the this project source code please?

    amitkushvaha@gmail.com
    psudheer28 wrote: »
    Hi
    Thanks for the tutorial. It was really a detailed on.
    It would be great if you can send me the sample code too.
    My email id : psudheer@hotmail.com


    Hey guys, just can't you see that he is telling over and over again that the download link is on the 2nd page. Just go and download, it is a working line.
  • PuchkoffDevelopmentPuchkoffDevelopment Posts: 57Registered Users
    edited May 2011
    WilScott wrote: »
    Hey guys, just can't you see that he is telling over and over again that the download link is on the 2nd page. Just go and download, it is a working line.

    I am having a weird problem. My pdf uses 30 mb of ram when I load it, then if I dismissModalViewController and load it again it uses 60 mb of ram.
    How can I fix it and what am I doing wrong?
    Thanks!
    Check out my iPad apps: <a href="http://bit.ly/sdkbeginners"; target="_blank">SDK Tutorials for Beginners</a> <a href="http://bit.ly/sdkadvanced"; target="_blank">SDK Tutorials Advanced</a> <a href="http://bit.ly/sdkcocos2d"; target="_blank">SDK Tutoria
  • shasshas Posts: 20Registered Users
    edited June 2011
    I loaded one webpage on UIWebview and from there i clicked to download one pdf file, then PDF file opened in UIWebview

    I want to save this Opened PDF files into my iPad Also Later i want Browse these files and open again
Sign In or Register to comment.