PDF-View - Show PDF files in your own app

DonManfred

Expert
Licensed User
This is a wrapper for this github project.

pdfView
Version:
0.85
  • pdfView
    Events:
    • onLayerDrawn (cv As Object, pageWidth As Float, pageHeight As Float, Page As Int)
    • onLoadComplete (Pages As Int)
    • onPageChanged (page As Int, pageCount As Int)
    Fields:
    • ba As BA
    Methods:
    • AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
    • BringToFront
    • Initialize (EventName As String, pdffile As String, defaultPage As Int, showMiniMap As Boolean, enableSwipe As Boolean)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • enableSwipe (enableSwipe As Boolean)
      Dis- or Enable SWIPE
    • isZooming As Boolean
    • jumpTo (page As Int)
      Go to the given page.
    • loadPages
      Load all the parts around the center of the screen,
      taking into account X and Y offsets, zoom level, and
      the current page displayed
    • loadpdf (pdffile As String, defaultPage As Int, showMiniMap As Boolean, enableSwipe As Boolean)
    • moveRelativeTo (dx As Float, dy As Float)
      Move relatively to the current position.
      dx: The X difference you want to apply.
      dy: The Y difference you want to apply.
    • moveTo (offsetX As Float, offsetY As Float)
      Move to the given X and Y offsets, but check them ahead of time
      to be sure not to go outside the the big strip.
      offsetX: The big strip X offset to use as the left border of the screen.
      offsetY: The big strip Y offset to use as the right border of the screen.
    • recycle
      Recycle the loaded PDF
    • resetZoom
    • resetZoomWithAnimation
    • toCurrentScale (size As Float) As Float
    • toRealScale (size As Float) As Float
    • zoomCenteredRelativeTo (dzoom As Float, pivot As PointF)
    • zoomCenteredTo (zoom As Float, pivot As PointF)
      Change the zoom level, relatively to a pivot point.
      It will call moveTo() to make sure the given point stays
      in the middle of the screen.
      zoom: The zoom level.
      pivot: The point on the screen that should stays.
    • zoomTo (zoom As Float)
      Change the zoom level
    Properties:
    • Background As Drawable
    • Color As Int [write only]
    • CurrentPage As Int [read only]
      Return the current page which is displayed
    • CurrentXOffset As Float [read only]
    • CurrentYOffset As Float [read only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • OptimalPageWidth As Float [read only]
    • PageCount As Int [read only]
      Return the PageCount
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
    • Zoom As Float [read only]


The Library is tested with the following Android Versions/Devices but it should work with android 2.3+ too:
- 5.1 (Lollipop) - my Galaxy Note 3 (rooted with Custom ROM)
- 4.4.2 (KitKat) - my Galaxy TabPro 12,1
- Samsung S3 mini - 4.1: ok
- HTC desire(flashed up) - 3.2: ok
- Nexus 6 : ok
- Nexus 4 : ok
Lemovo p780 : ok
Motorola Moto G XT1032 : ok
WIKO King : ok
WIKO Cink : nok
WiKO Slide : ok
Sony Xperia : nok
Rock V5 : OK
Titan T1 : nok

The Example you get when donating is the sourcecode of the following APK

Due to the size of the Library and the example i put it on my Dropbox.

- You can download the Example APK here.

You can see the Example on Appetize.IO too.




The library is not free. You need to donate as low as 11€ to get the library.

To donate for the Library you need to follow this steps:
- Click on Donate-Button below
- Please enter your forum-username in the comment-box in the payflow so that i can know who donated for the library! ;-)
- Please be patient and give me 24h to process your payment and to send you the link to download the Library files.


UPDATE 16th May 2016: The Library is now FREE


 
Last edited by a moderator:

Ohanian

Active Member
Licensed User
Hi,

Can you add a browse button to the example apk so i can check a non-English pdf?
And if you add a custom encryption/decryption method to this lib it would be terrific.
 

susu

Well-Known Member
Licensed User
Does your lib support PDF file with password?
 

Marco Nissen

Member
Licensed User
I tried to use the following line:
Dim c As Canvas = cv

I get this error:
java.lang.ClassCastException: android.view.Surface$CompatibleCanvas cannot be cast to anywheresoftware.b4a.objects.drawable.CanvasWrapper

Is there a possibility to use the canvas to draw a rect on top of the drawing area?
 

DonManfred

Expert
Licensed User
I get this error
yes, this seems to not work. i´ll remove the given parameter i think...
Is there a possibility to use the canvas to draw a rect on top of the drawing area?
I think no. I dont saw any method in the wrapped library with which you can draw your own things on the surface.
 

shashkiranr

Active Member
Licensed User
Hi @DonManfred ,

I installed the example apk. the library looks good but there is a lag while rendering the pages. if you zoom in or zoom out also you can see it. Is the problem with the pdf file or is there any way the rendering can be improved.

Regards,
SK
 

DonManfred

Expert
Licensed User
there is a lag while rendering the pages
Yes. It is a thread running the native .so method. The speed depends on your devicesspeed and the complexity of the pdf...
I have no chance of make this faster. The vuDroid must be extended... But i dont think that the vuDroid is still maintained as the last download on the website is from 2011....
 

scsjc

Well-Known Member
Licensed User
hello, i'm very interesting on your library, but i test on SAMSUNG GT-S6500 2.3.6 GINGERBREAD.BUMD1, and don't work.....
that can't fix... ??? or don't have a solution for old machines ???
 

DonManfred

Expert
Licensed User
test on SAMSUNG GT-S6500 2.3.6 GINGERBREAD.BUMD1, and don't work
I dont have such old devices. The lib should work from android 2.3 if i can trust the info here.
Maybe it is another part of the example i wrote which does not work on your device. Sorry, i dont know.
 

scsjc

Well-Known Member
Licensed User
I dont have such old devices. The lib should work from android 2.3 if i can trust the info here.
Maybe it is another part of the example i wrote which does not work on your device. Sorry, i dont know.
ok, and the final cuestion, work with the version b4a 4.30 ???
if is yes, i try.
thanks.
 

welu1805

Active Member
Licensed User
Hi DonManfred,

I installed the Example APK on my Tablet Pearl Touchlet X10.quad.v2. It works good.

Is it possible to have the pages of the pdf vertically and if yes, how can I get the entire height of all pages in pixels"?
 
Top