Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 71

Walms
Code is Art
Profile
Posts: 235
Reg: Aug 24, 2011
Derby
3,300
12/15/12 10:44 AM (13 years ago)

PDF Plugin feature not functioning

The "Launch in native app" feature does not seem active with this plugin. I have the option set to "yes" in the CP, I have Adobe reader app installed on my iPhone yet the button remains greyed out? Would be nice if this worked would add alot more interactivity to my pdf files. As a work around I just have users email the pdf and edit outside the app
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
12/15/12 10:58 AM (13 years ago)
Haven't heard this before: "button grayed out" - not sure what this means. The Adobe Reader App (installed on your iPhone) doesn't have anything to do with this plugin's behavior. When the screen loads is looks for the PDF included in the app's bundle, or from a URL. The PDF is displayed in the iOS Developer Kit's UIWebView, just like the other document type Plugins. Have you looked at the output console to see where the app is looking for the PDF? The Output Console will show you where the screen is looking for the PDF (with the app running, and connected to Xcode.)
 
Walms
Code is Art
Profile
Posts: 235
Reg: Aug 24, 2011
Derby
3,300
like
12/15/12 11:14 AM (13 years ago)
the plugin as a whole is working ok, It can view my pdf file just fine. What I am referring too is in the CP under document behaviour > Show Launch in Native App Button I set option to "Yes, show the button" I assume like similar plugins this will launch native app (in my case adobe reader), the button on the bottom menu bar is displayed but "greyed out" or translucent. The email button to the right works I did have this feature working great at one point but seems maybe a package/plugin update has caused a problem
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
12/15/12 11:20 AM (13 years ago)
Ah, make much more sense. I'm looking at the Plugin now. Have a look at line 194 (or so) of the BT_screen_pdfDoc.m file. It's looking at each button in the bottom toolbar. The button for the launch native app function has a "tag" of 103. If this button exists in the toolbar, AND the screen does NOT use a dataURL, the button is disabled. The idea is that the Launch In Native App button will only work if the PDF is coming from a URL and not a local file compiled in the project. I haven't seen this code for awhile and had forgotten this. Maybe do a test and use a dataURL to a PDF to verify that it works that way? If it does, you could then use a dataURL (remote PDF) or, I could try to work out a way to open a local PDF (in the bundle) in the Native App.
 
Walms
Code is Art
Profile
Posts: 235
Reg: Aug 24, 2011
Derby
3,300
like
12/15/12 11:31 AM (13 years ago)
ahhh makes more sense now to me also :) I originally had the PDF files hosted externally but to improve performance I then added them to my app bundle. I have no problem pulling these through DataURL, as I already do this with my Android project so they will be centrally managed. I will make the changes now. Thanks David
 

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.