You only need to do this in your application, no need for forking PdfiumAndroid or so. Most important section is Improving multiple APKs creation and versionCode handling with APK Splits, but whole article is worth reading. There is good article on automatically splitting your application into multiple apks, Void setMaxZoom( float zoom) Possible questions Why resulting apk is so big?Īndroid PdfViewer depends on PdfiumAndroid, which is set of native libraries (almost 16 MB) for many architectures.Īpk must contain all this libraries to run on every device available on market.įortunately, Google Play allows us to upload multiple apks, e.g. Predefined providers can be used with shorthand methods: Predefined providers are available in .source package and can be used as Version 2.3.0 introduced document sources, which are just providers for PDF documents.Įvery provider implements DocumentSource interface. You can also create custom scroll handles, just implement ScrollHandle interface.Īll methods are documented as Javadoc comments on interface source. scrollHandle(new DefaultScrollHandle(this)).ĭefaultScrollHandle is placed on the right (when scrolling vertically) or on the bottom (when scrolling horizontally).īy using constructor with second argument ( new DefaultScrollHandle(this, true)), handle can be placed left or top. There is default implementation shipped with AndroidPdfViewer, and you can use it with This method accepts implementations of ScrollHandle interface. To use scroll handle just register it using method Configurator#scrollHandle(). Scroll handle is replacement for ScrollBar from 1.x branch.įrom version 2.1.0 putting PDFView in RelativeLayout to use ScrollHandle is not required, you can use any layout. pages is optional, it allows you to filter and order the pages of the PDF as you need.WHITE) // color of page that is invalid and cannot be loaded To define spacing color, set view background enableAntialiasing( true) // improve rendering a little bit on low-res screens // spacing between pages in dp. enableAnnotationRendering( false) // render annotations (such as comments, colors or forms) onRender( onRenderListener) // called after document is rendered for the first time // called on single tap, return true if handled, false to toggle scroll handle visibility onLoad( onLoadCompleteListener) // called after document is loaded and starts to be rendered allows to draw something on all pages, separately for every page. allows to draw something on the current page, usually visible in the middle of the screen enableSwipe( true) // allows to block changing pages using swipe pages( 0, 2, 1, 3, 3, 3) // all pages are displayed by default fromStream( InputStream) // stream is written to bytearray - native code cannot use Java Streams or pdfView. Library is available in jcenter repository, probably it'll be in Maven Central soon. default scroll direction is vertical, so Configurator#swipeVertical() was changed to Configurator#swipeHorizontal()Ĭompile ':android-pdf-viewer:2.8.2'.added OnPageScrollListener listener due to continuous scroll, register with Configurator#onPageScroll().added scroll handle as a replacement for scrollbar, use with Configurator#scrollHandle().
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |