Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 18    Views: 77

WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
08/30/13 02:16 PM (12 years ago)

PDF - hyperlink (yeah, again)...

Ok, so a long time ago I would have thought this was a reasonable question. After doing this for a while in iOS and Android I realize all the problems associated with trying to do this, but just in case someone has some out of the box idea for solving this.... I have a customer that we will be building a primarily PDF based app for, about 200 or so PDF screens. The PDFs have hyperlinks on them that, when all this data was a single PDF, would allow you to hop around from page to page using the links. The customer would like to retain this functionality. I think Chris's HTML Pro plugin is the closest I've seen to this being possible. Is there a way to do this with PDFs that will work on iOS and Android? Tim
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
08/30/13 07:11 PM (12 years ago)
I have your answer, Tim. Ian and I have the perfect plugin. It works so, so well. I haven't tried to use it with a link yet, but I would be surprised if it doesn't work. Ian and I are just waiting for the market to open up.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/30/13 11:22 PM (12 years ago)
Hello Tim, You can use App URL Schemes. Your app would respond anytime a URL of wolf://PDFname?page=20 was tapped on the iOS device within any app. Then your app would process the URL by parsing out the two parameters: - the PDF File to be opened - the page number to view within that PDF File To learn more about this approach, here are a few links to peruse: http://maniacdev.com/2013/08/open-source-helper-library-making-it-easier-to-work-with-app-url-schemes
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/30/13 11:30 PM (12 years ago)
Here is an example of an open-source PDF app that was integrated with the Ink URL Scheme library. Original PDF App is https://github.com/vfr/Reader The Ink'd version of that app is: http://blog.inkmobility.com/post/59031713981/thatpdf-a-simple-way-to-annotate-and-sign-pdfs The Ink framework is at http://inkmobility.com/ -- Niraj
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
08/31/13 04:55 AM (12 years ago)
Thanks guys. Guess I didn't explain we'll enough; I need the link in the PDF, which will be on a PDF screen, to open a Buzz screen (not always another PDF) Thanks! Tim
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
08/31/13 08:03 AM (12 years ago)
I am pretty sure you could just form a URL like Chris does in the HTML Pro plugin. http://www.buzztouch.com/files/howtos/Using%20the%20HTML%20Pro%20plugin.pdf Take a look at page 13.
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
08/31/13 08:54 AM (12 years ago)
You think a PDF doc with an href link to a screen ID will open that screen? Tim
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/31/13 09:06 AM (12 years ago)
I went through the PDF that Susan recommended for reading. It is close, but no cigar. The basis of that plugin is an HTML File. Yours is a PDF File. I think the URL Scheme is the sure fire method. Now that I understand your goal, the URL would be: AppName://screenNickname or it would be AppName://screenID The URL Scheme capability is a fundamental thing such that it would be implemented in the BuzzTouch Core, not as a Plugin. -- Niraj
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
08/31/13 09:13 AM (12 years ago)
Ok, thanks. Will try that, just tried the href="ID", didn't work... Tim
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
08/31/13 09:16 AM (12 years ago)
Another dumb question: Is the AppName as referenced above the app name in Buzz, the bundle identifier, the bundle name...?
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
08/31/13 09:31 AM (12 years ago)
Tried, doesn't work unless I'm not constructing the URL incorrectly. tried AppName://screen id using the bundle name for AppName, and the screen id with and without quotes. Tim
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/31/13 10:16 AM (12 years ago)
I am sorry, Tim. I said something that was obvious in my mind but had not yet explained out loud. Read this great explanation, I continue to be impressed by this web site: http://www.idev101.com/code/Objective-C/custom_url_schemes.html Then after you implement the "handler", you will need to put in code for a "redirect" to open the desired screen by it's Nickname. The Links within the PDF will be of the style MadeUpAppName://ScreenNickname Now that you got me thinking about it even more, I think this is doable just within your App's Delegate file! No need to implement a BuzzTouch Core or even a Plugin. If you want to talk it through on the phone, let me know. I have to head out right now, but when I get back, I shall try it on my own to validate this advice. :-) -- Niraj
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
08/31/13 10:23 AM (12 years ago)
I see where you're going with this, seems possible. Just from the little tinkering this morning I have a feeling that once again Android will be an issue, this will largely depend on the pdf reader on the user's device and what it will and won't allow link-wise. Just supposition at this point, worth a try I think. Tim
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
09/01/13 10:16 AM (12 years ago)
I'm making progress ... I have done these things successfully: 1. Registered the custom URL Scheme by making entries in the BT_info.plist file 2. Created a custom URL within an HTML5 screen of the app Niraj://myCoolScreen (Not to worry, it will work equally as well on a link within a PDF) 3. Into the App Delegate file, added a handler for receiving a tap on that URL Scheme of Niraj:// 4. Within that custom URL Scheme's Handler, added NSLog messages to show on the Console that we got to the Handler and we understand the next screen to be loaded 5. The Console shows we got to the Handler 6. The Console shows we understand the screen to be loaded: myCoolScreen was reported 7. Use code from a plugin on how to load the next screen upon a tap THINGS TO DO NEXT (I get compile errors, red stop signs) 1. Get the next screen's ScreenData 2. Get rid of the compile errors Running off to the Apple Store to have them wipe a jailbroken iPhone ... Upon my return, with a bit of research and a few fixes, it should then simply just work! :-) Of course, I'm thinking about creating a how-to by using ScreenSteps or Clarify :-) -- Niraj
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
09/01/13 10:18 AM (12 years ago)
Niraj, if you can't figure this out, this would be a good topic for a Developer Meeting with David. We need the Android too.
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
09/01/13 10:28 AM (12 years ago)
You go Niraj! This will be a big help to a lot of people I suspect! Tim
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
09/01/13 12:04 PM (12 years ago)
It will be awesome to figure this out, and get something in the How-to's. Thank you, Niraj!
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
09/02/13 02:49 AM (12 years ago)
Tim and Susan, If you want to give it a whirl, I have the iOS part ready to test. (don't worry, I don't have the skills to do Android this year :-) Download this PDF file and follow the instructions. Wow -- did it really get to 40-pages?! http://d.pr/f/yATz Even though this is not an actual Plugin, this may actually eliminate the need for the HTML Pro plugin (if I correctly understand the purpose of that plugin). My tests show that one can load any type of screen from any other type of screen as long there is a tappable link in HTML or PDF format. Critique and feedback is encouraged. :-) -- Niraj
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
09/02/13 07:03 PM (12 years ago)
I have to say, this is one of the best How-To's I have ever read. Every detail is included, down to the BT_debugger and thoughtful comments to include in the code. I'll have it posted in a few minutes. Thank you so much, Niraj! Excellent work!
 

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.