1

Like in iPhone simulator we can drag and drop an image and store it in photo library by double clicking and saving. How can we store pdf formatted files in iPhone simulator version 5.0 specifically.

David Ravetti
  • 2,030
  • 1
  • 17
  • 22
Max_Rai
  • 68
  • 1
  • 10
  • I Guess,you can only bookmark the file location or add it reading list by opening the "share" pop up from the viewer rather storing it in the library. Library is for the photos only. – Kuldeep Mar 23 '12 at 11:48
  • is there a solution so that I can access pdf file stored in my iPhone, using app i am creating? – Max_Rai Mar 23 '12 at 12:00
  • You want to drop a pdf file in iphone simulator , for what purpose. Is this question constructive ? – Dushyant Singh Mar 23 '12 at 12:08
  • 1
    Read the documentation of UIDocumentInteractionController. You can access the stored document, but for that use has to open that document via your app like we do "Open With" in our desktop apps. – Kuldeep Mar 23 '12 at 12:11
  • coder007- i want to upload a pdf file stored in my iPhone to the application i created. Thats why I want to know – Max_Rai Mar 23 '12 at 12:25

2 Answers2

3

I can't speak for iOS simulator v5 but in 7.1 you can simply drag your PDF to an open simulator. The PDF will open in safari where you can either save it your home screen or bookmark it. Alternatively, you could type the file path into the URL bar ala:

file:///Users/claristhecowdog/Documents/ImACowImADog.pdf
Jack Frost
  • 2,151
  • 3
  • 17
  • 21
0

What you want is in the NSFileManager APIs. "… from library or something like that" is too vague - where exactly will the PDF come from? Did your application download it? Are you saving it correctly to your own application's sandbox (i.e., in the Documents directory)? iPhoto Library does not handle PDFs (only images), so for PDFs (and all other non-picture types) you have to handle storing/finding it yourself.

Scott Corscadden
  • 2,831
  • 1
  • 25
  • 43
  • yes exactly thats what I want to know that how to handle/find the pdf from iPhone. the pdf will be stored by user of application on his own iPhone, so how is he going to access it from my application? – Max_Rai Mar 24 '12 at 07:21