Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 31    Views: 128

SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
07/09/14 06:18 PM (10 years ago)

New Plugin: Smugs Android PDF Viewer

Announcing Smugs Android PDF Viewer. https://www.buzztouch.com/plugins/plugin.php?pid=98A4804AC048C825A1E51F0 Just like it sounds, the Smug PDF Viewer allows you to view PDF Files without the assistance of a 'helper' application. • No longer will users need to 'leave' your app to view your pdf documents • New users confused with the concept of 'Helper' applications no longer need to worry. • Keeps your users 'IN' your app. Based on Joe Blough's project using the AndPDF library. https://github.com/jblough/Android-Pdf-Viewer-Library Please feel free to ask questions. Cheers! -- Smug PS, Thanks Cake for the 'correct' URL, lol! :)
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
07/09/14 06:29 PM (10 years ago)
nice! great job Smug!
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
07/09/14 06:30 PM (10 years ago)
finally!!!! very much needed.
 
Cakebit
Code is Art
Profile
Posts: 501
Reg: Dec 15, 2010
In your local b...
16,510
like
07/09/14 07:16 PM (10 years ago)
That's awesome Smug! FYI: The link to your plugin in your post wasn't working... you might want to replace it with this: https://www.buzztouch.com/plugins/plugin.php?pid=98A4804AC048C825A1E51F0 :D Cheers, -Cake
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/09/14 08:32 PM (10 years ago)
Congrats Smug - this is long awaited. Now can you make a native Word viewer? :)
 
KennedyE
Android Fan
Profile
Posts: 373
Reg: Dec 07, 2013
PH, Nigeria
3,730
like
07/10/14 02:26 AM (10 years ago)
Great plugin there Smug! Adding search button if possible will be great also. Thanks!
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
07/10/14 06:16 AM (10 years ago)
Hey Smug, could you add a dataURL field, to read the pdf files from other sites?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/10/14 06:37 AM (10 years ago)
Dusko, Eventually I will, it won't be tomorrow, but probably more like, within the next couple of weeks. In all honesty it was built out of an immediate need, which has been satisfied. That *is* a feature I want to include, but I've solved my problem and will return to add that when I'm finished with my current project. It'll come. Just not today. Cheers! -- Smug
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
07/10/14 07:35 AM (10 years ago)
Smug, thank you for the fast response.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
07/10/14 07:47 AM (10 years ago)
Yay! :-) whew!
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
07/10/14 08:42 AM (10 years ago)
This is great! Good job smug!
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
07/10/14 09:13 AM (10 years ago)
This is a good idea and plugs the hole that the BT 3.0 core plug-in left. Nice one Smug.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
07/23/14 02:46 PM (10 years ago)
Can we hope to get the datURL option into this plugin?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/23/14 04:55 PM (10 years ago)
Dusko: yes... just gimme another couple of days... Cheers! -- Smug
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
07/23/14 09:36 PM (10 years ago)
>Dusko: yes... just gimme another couple of days... Thank you, eagerly awaiting!
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
08/20/14 02:14 PM (10 years ago)
Hey Smug, just bought and installed your plugin, but it will not work for me. I get the following error: "The import com.pdfviewer cannot be resolved" The resource is SW_pdfViewer.java Checked all files, they are all in place and added the activity in my manifest.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/20/14 02:44 PM (10 years ago)
Make sure that SW_pdfViewer.java SW_pdfViewerActivity.java is in your src directory, and has no errors. make sure that PdfViewer.jar is in your lib directory make sure that sw_dialog_pagenumber.xml sw_pdf_file_password.xml sw_pdfviewer.xml is in your res/layout directory make sure that swpdf_left_arrow.png swpdf_right_arrow.png swpdf_zoom_in.png swpdf_zoom_out.png is in your res/drawable directory and there is a test document: sw_sample.pdf that should be in assets/BT_Docs And of course, check your API Level, and make sure it's around API 14. Also, these days whether you use google or not, Google Play Services need to be in your project. Cheers! -- Smug
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
08/20/14 02:55 PM (10 years ago)
Hey Smug, I always double-check all the simple things so I have to disappoint you, it is all as it should be :( Obviously the SW_pdfViewer.java is not without errors as that is my problem ;-)
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
08/20/14 03:00 PM (10 years ago)
In my version of this plugin, it says this: import net.sf.andpdf.pdfviewer.PdfViewerActivity; Maybe you can try that line out?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/20/14 03:54 PM (10 years ago)
Dusko has a point; just 'com.pdfViewer' isn't quite correct. I checked in the package and it's like he says: import net.sf.andpdf.pdfviewer.PdfViewerActivity; is the correct line. Does yours say something different? Does the project have errors? Cheers! -- Smug
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
08/20/14 04:12 PM (10 years ago)
I have both, the import lines on the SW_pdfViewer.java look like this: import com.pdfviewer.BT_screen_menuListSimple.DownloadScreenDataWorker; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import net.sf.andpdf.pdfviewer.PdfViewerActivity;
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/20/14 07:28 PM (10 years ago)
delete "import com.pdfviewer.BT_screen_menuListSimple.DownloadScreenDataWorker;" Cheers! -- Smug
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
08/21/14 02:07 AM (10 years ago)
Yeah, tried that already, still the same error, even after cleaning :-(
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/21/14 04:07 AM (10 years ago)
Well, could you provide some information... 1) Does it compile, or does it have errors. 2) If it has errors, is the PDF plugin the only file with an error? 3) If it compiles, when does it crash? 4) If it crashes, could you provide about 10 lines before it crashes, and about 10 lines after it crashes from the log cat? In addition, any information that you might consider pertinent. Cheers! -- Smug
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
08/21/14 05:48 AM (10 years ago)
Restarted Eclipse for the 3rd time and magically the error was done after deleting the error line "import com.pdfviewer.BT_screen_menuListSimple.DownloadScreenDataWorker; " Tried that several times before without luck, but hey, it is Android, right? Thx for the support!
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
08/21/14 05:52 AM (10 years ago)
Just some feedback on the plugin itself: If you press the android build in back button you just see a white empty screen instead of the menu (in my case menu advanced with your PDF plugin as one of the menu items). Needs to be pressed twice to get back to the menu I came from. If I open on my Galaxy S5 it is very small. Yes, I can press the loop and make it bigger but for future updates it would be nice if it opens up in full screen like on iOS.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/21/14 06:09 AM (10 years ago)
Well, truth be told, it's not perfect, lol! I'm working on redoing the plugin using a different 'engine', but time constraints have limited my progress on this. However, rest assured it is ongoing. At the moment, I'm still looking at using 'MUPDF', but haven't found a way to make it as 'seamless' as possible. I'm also looking at a couple of other solutions, but again it'll take a bit of time. Thanks for your patronage, and patience. Hopefully we'll have something more bulletproof for the future; for the moment we're stuck with what functionality can be provided with 'pdfViewer.jar' Cheers! -- Smug Just a short note on operation: What's actually happening, is the 'pdfViewer.jar' is sort of an app within the app. so, when you 'call' the SmugPDF viewer what happens is it starts a new activity, or app, with the pdf viewer. It 'transitions' to the smugpdf screen, which then calls the activity, and transitions to the actual PDF being displayed. So, when you press the back button, it leaves the activity, and returns to the smugPDF screen. and then from there, you press once more to return to the menu. It's not perfect by any means, lol! which is why I'd like to change the behavior. But it's better than launching another app 'outside' of your app. I just need to find a better 'engine'.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
08/21/14 12:26 PM (10 years ago)
yeah all good, thx and keep up the good work :-)
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
08/21/14 08:13 PM (10 years ago)
You are a genius, Smug. And a very good General Manager :-) -- Niraj
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/29/15 05:56 AM (9 years ago)
Hi smug, Will this work on self hosting, Im getting crash when trying to open your plugin :) cheers dude ps ALL fixed and working now after couple restarts, im not getting the pdf to show correctly though, its showing larger version of the pdf , its in black and white, and looks like its overlapping 2 of the same images sean
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/29/15 07:09 AM (9 years ago)
If the PDF is compressed it tends to display oddly. Try an uncompressed PDF version, and that should clear things up a bit. Cheers! -- Smug
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
06/29/15 07:28 AM (9 years ago)
I have 36 pdf files within the project and there all compressed to keep the file size down, theres no masters, so that would mean redoing all the files from scratch,works great on ios, but android is pain with pdfs, having to click and then choose which program to use, i will have to find different route, any pointers on a way to have click able part of an image in a image cheers Sean
 

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.