Discussion Forums  >  Images, Documents, File Locations

Replies: 7    Views: 114

Wopperkasper
I hate code!
Profile
Posts: 10
Reg: Aug 03, 2013
lyngby
100
08/05/13 06:14 PM (10 years ago)

Save PDF in app?

My app has some different PDF files in it, but i would like a way to save the PDF (or the shortcut to the file) in a menu tab. So let's say I'm using my app and i come across a PDF file that i find interesting and i want to read that again later without browsing through the entire app to find it again. So if I could somehow make an save button that makes a shortcut to one of my simple menus. Is that possible and if so how can i do it?
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/05/13 06:45 PM (10 years ago)
Not sure exactly what you are trying to do and how you are doing it. I have had a lot of success copying and pasting the pdf into my resources folder so it could be accessed very quickly via a menu or whatever.... Are you creating this app from scratch or are you using the BT software?
 
Wopperkasper
I hate code!
Profile
Posts: 10
Reg: Aug 03, 2013
lyngby
100
like
08/05/13 06:56 PM (10 years ago)
I'm using the BT software. My app features a tabbed layout so in my main tab there is a button screen, and there is a lot of categories for example lets say that there is a category that is called "pear". when i go to the subcategory called "pear" i see a simple menu of different PDF/Word files. Now lets say i open one titled "banana" and i see a PDF, and i would like to read that PDF again at a later time, but i don't want to first press the "pear" category and then go browse through the entire menu every time just to get it. I have two Tabs one is the button one and the other is a simple menu. So is there a way to make a shortcut to the PDF while inside the app, so that it would appear on my simple menu. Kinda like bookmarks for a browser And of course this would all be done inside of the app I hope you can understand what it is I'm trying to do :)
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/05/13 07:30 PM (10 years ago)
Yeah I know exactly what you are trying to do. You would need to create a custom class in your app, let say you name it "recent documents." It would have a list of the last 5 documents, or however many that was opened inside the app. You would need to have a sql server to store data that is created by the user of your app. It wouldn't take a lot of work to do something like this, but you would need to decide if the time and cost of doing something like this would be justified. I use to be a database guy in my former life so I could help you if you think the end justifies the effort. Allan
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/05/13 07:40 PM (10 years ago)
You 'can' do that inside the app, but you'll need to customize your plugin for that functionality. Once you 'have' the document in cache, it's pretty easy to save it locally. This is 5 lines of code that I use to download and save a weather JSON file to my app 'data' directory: NSString *myFile = [BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"weatherURL" defaultValue:@""]; NSURL *url = [NSURL URLWithString:myFile]; NSData *urlData = [NSData dataWithContentsOfURL:url]; NSString *theEncodedString = [[NSString alloc] initWithData:urlData encoding:NSUTF8StringEncoding]; [BT_fileManager saveTextFileToCacheWithEncoding:theEncodedString fileName:saveAsFileName encodingFlag:-1]; Of course, what you want to do is slightly more detailed, so you'll also have to keep track of the files, and stuff like that. More to do, but not 'that' complicated... just break it down into little 'one item' tasks, and keep at it. Cheers! -- Smug
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/05/13 07:47 PM (10 years ago)
Yeah smug is right. You could do it with a custom plug in. But you would need help doing that. Creating a plugin is more buzztouch than a xcode or database. Let me know which way you need to go and I would be happy to help you.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
08/06/13 01:33 PM (10 years ago)
My favourites plugin does just that, check out my YouTube page Www.youtube.com/kittsapps Ducking out before I'm caught on here. (On honey moon)
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
08/07/13 07:55 AM (10 years ago)
^ wow. Congrats! Hope you are somewhere exotic with lots of sunshine and booze. Good Luck! https://itunes.apple.com/us/app/marriage-fight-tracker/id368154763?mt=8&ign-mpt=uo%3D4
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.