Save .pdf files and show in offline mode

Discussion in 'iOS Development' started by hallo, Mar 2, 2009.

  1. hallo

    hallo New Member

    Joined:
    Sep 28, 2007
    Messages:
    33
    Likes Received:
    0
    Device:
    2G iPod touch
    Hi everyone,
    I am new in the iPhone Developing Scene and just started building my own apps. I made a app in which shows the substitute teacher plan of my school. It is a simple webView app. The file is a .pdf file and I now want to save the actual plan and show it in offline mode. Can anybody help me?

    Greets from Germany...

    sorry for my bad english. I hope you understand where my problem is....

    Please Register or Log in to view images

  2. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Viola! Also, voila!

    Code:
    NSString *pathToYourPDF = [NSString pathWithComponents:[NSArray arrayWithObjects:[[NSBundle mainBundle] bundlePath], @"YourPDF.pdf", nil]];
    [yourWebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath: pathToYourPDF]]];
  3. hallo

    hallo New Member

    Joined:
    Sep 28, 2007
    Messages:
    33
    Likes Received:
    0
    Device:
    2G iPod touch
    thank you! gonna try it tonight
    ------------------double post merged------------------
    so I implemented the script and it works fine...BUT I got to copy the file manually from Mac to the applications directory to be shown. Now I want to download it from a website, save it and display it if no wifi is on....i don`t know how to save content from internet(it is a very small file so i can save it in the application directory i think) so can anybody help me?

    Please Register or Log in to view images

    would be great

Share This Page