Save a PDF on Home Screen?

Discussion in 'Jailbreaks and iOS Hacks' started by rkhoo, Oct 8, 2009.

  1. rkhoo macrumors newbie

    Joined:
    Aug 6, 2009
    #1
    Is there any way to save a PDF or an Icon representing a saved PDF on a Home Screen? Selecting the Icon would use the Iphone's viewer to view the document. I have several reference sheets that I access several times a day and it would be so simple if I could just pick them on my home screen without having to wait for another program ie Documents to Go, Mobile Office, etc... to open up. I've seen this same question on another Board but no answers so I know I'm not the only one that would like to do this. Thanks.

    Jailbroken 3G 3.01
     
  2. darngooddesign macrumors G3

    Joined:
    Jul 4, 2007
    Location:
    Atlanta, GA
  3. rkhoo thread starter macrumors newbie

    Joined:
    Aug 6, 2009
    #3
    I appreciate your answer. But I was thinking of a solution that saved the pdf locally on the phone without the need to access the internet. I'm already able to save the docs in the programs that I mentioned before. I was just wondering if there was a hack or cydia program that allowed you to put documents on a home screen.
     
  4. foob macrumors 6502

    foob

    Joined:
    Feb 17, 2009
    #4
    I just figured this out and it's actually very simple, and once you do the first one, the rest are even easier. You can't edit the pdf or anything, you can only view it locally in Safari, so I'm not sure if this is what you want. But no internet connection is required.

    Install "file:// Schema in Safari" from Cydia.

    Create a webclip for a random site, let's use google for example.

    I suggest using iFile (from Cydia, not the app store) for the rest of this, but there are other ways as well.

    Go to /var/mobile/Library/Webclips and find the folder for the webclip you created. If you have a lot of webclips, it may take a lot of searching since they have gibberish names, just keep going into folders and opening the icon.png to see what that webclip is for.

    Once you find it, edit the info.plist. Near the bottom, replace "http://www.google.com" with "file:///var/mobile/wherever/the/file/is/file.pdf".

    You now have a google webclip with a google icon that will open your pdf when clicked.

    Now, this is the cool part...

    Click on the google webclip and let it load your pdf. Now create a webclip. The webclip icon will be a preview of the pdf file and you can name it whatever you want. Then you can delete the google webclip.

    Open the webclip and in the address bar you will see "file:///var/mobile/wherever/the/file/is/file.pdf" If you want another webclip for a different file, just change the address to point to that file, click "go", and create another webclip after that file is loaded.

    Again, you can only view the files, not edit them, so I hope it helps.
     
  5. foob macrumors 6502

    foob

    Joined:
    Feb 17, 2009
    #5
    You know what, there's no reason to create a google webclip and edit the plist. Just type file:///var/mobile/wherever/the/file/is/file.pdf in Safari then create the webclip you want on the first try.

    I approached it by trying to edit a webclip and once that worked, I realized I could create new webclips based off the edited one, but failed to note I could just skip the first step altogether.

    I need sleep...
     
  6. spencers macrumors 68020

    spencers

    Joined:
    Sep 20, 2004
    #6
    Very cool info!
     
  7. kate-willbury macrumors 6502a

    Joined:
    Feb 14, 2009
    #7
    lol @ how useless the iphone is without jailbreak!
     
  8. rkhoo thread starter macrumors newbie

    Joined:
    Aug 6, 2009
    #8
    Finally had a chance to try it. Unfortunately I get a message from Safari that it can not open it because its a local file. Hmm...
     
  9. foob macrumors 6502

    foob

    Joined:
    Feb 17, 2009
    #9
    Did you install the "file:// Schema in Safari" package from Cydia?
     
  10. rkhoo thread starter macrumors newbie

    Joined:
    Aug 6, 2009
    #10
    Sorry, missed that at first. After installing file:// Schema in Safari, didn't get that message again. Problem now is that using ifile I find the pdf or excel file, I use the bookmark function in ifile for the particular document so that I can copy and paste the file location and when I put that in the safari address bar I now get the message that there isn't a file at that location so I can't make a webclip onto the home screen.

    Here's an address that I tried (which happens to be a sample doc in Documents to go)
    file://localhost/var/mobile/Applications/A7B5610E-C2EC-4C52-BF71-4E290736EB6E/Documents/Local%20Files/ACME%20Quote-Word%202003.doc
     
  11. foob macrumors 6502

    foob

    Joined:
    Feb 17, 2009
    #11
    try removing "localhost" from the first part "file://localhost/var/...."
     
  12. foob macrumors 6502

    foob

    Joined:
    Feb 17, 2009
    #12
    Actually, that won't work. I'm trying this too and have the same problem...
     
  13. foob macrumors 6502

    foob

    Joined:
    Feb 17, 2009
    #13
    Hmmm, I can't get it to read any file in the Applications directory, even a simple text file that I create. But if I move any file from Applications/random_app up to /var/mobile, it will read that. If I try to open a directory in Applications, it says there is no file at that location, but if I try to open any other directory, it says it can't open it because it's a directory, which would be the correct error. It doesn't seem to work with the Applications directory at all.

    I don't get it, because the permissions for Applications are ok. It's like the File Schema or Safari has a built in block.

    The only foolproof way I know to get it to work right now is to move the files to a new directory in /var/mobile, but that probably won't help because you'd have to copy them to /var/mobile again if you edit them in Documents to go.
     
  14. rkhoo thread starter macrumors newbie

    Joined:
    Aug 6, 2009
    #14
    I appreciate you giving it a shot. I guess if it's a big enough deal I can SSH into my phone and put the doc there that way.
     
  15. Night Spring macrumors G5

    Night Spring

    Joined:
    Jul 17, 2008
    #15
    Did you try using AppLink to create shortcuts to the Applications directories, then see if Safari would open document files if you type in the shorcut links? Unfortunately, I can't test this myself at the moment, since my partner and his jailbroken iPhone are away for the weekend.
     
  16. rkhoo thread starter macrumors newbie

    Joined:
    Aug 6, 2009
    #16
    Used cyberduck and created a new folder in var/mobile called "home screen docs". Transferred a few docs including a pdf and an excel phone list. Put the new addresses in safari and created webclips on home screen. It works fine. In fact the phone numbers are selectable so you can call from that screen. That's a bonus as far as I'm concerned. I am kind of surprised that no one has put together an app allowing this to be done. I don't consider myself to be super computer literate but can see how an app could automate the process. Thanks for your help.
     
  17. foob macrumors 6502

    foob

    Joined:
    Feb 17, 2009
    #17
    rkhoo, I'm glad it's working for you.

    I was thinking of ways to use this trick today and came up with an idea. You could create an html page, put it on the phone and make a webclip for it. The html page could link to all your files, and you can put phone numbers or email links on it so everything would be right there on one page.

    Here is a list of ways to use links for iphone functions as well as some third party apps, and here is a quick html example of how I thought of using it.

    Code:
    <html>
      <head>
        <title></title>
        <meta content="">
        <style></style>
      </head>
      <body>
    <a href=file:///var/mobile/bills.pdf>Bills</a><br>
    <a href=file:///var/mobile/work_accounts.doc>Work</a><br>
    <a href=file:///var/mobile/mynotes.txt>notes</a><br>
    <p>
    Phone Numbers:<br>
    <a href="tel:123-456-7890">work</a><br>
    <a href="sms:123-456-7899">txt wife</a><br>
    <p>
    Email<br>
    <a href="mailto:joe@example.com">Joe</a><br>
    </body>
    </html>
    
    [​IMG]

    Yeah, I did try Applinks. I tried everything. Either it just won't work or I was doing something really stupid. Could be either.
     

Share This Page