Class PdfReaderView

  • All Implemented Interfaces:
    android.graphics.drawable.Drawable.Callback , android.view.KeyEvent.Callback , android.view.ViewManager , android.view.ViewParent , android.view.accessibility.AccessibilityEventSource , com.pspdfkit.internal.document.reflow.ReflowProcessorListener , com.pspdfkit.ui.PSPDFKitViews.PSPDFView

    
    public class PdfReaderView
    extends FrameLayout implements PSPDFKitViews.PSPDFView, ReflowProcessorListener
                        

    Reader View component containing a styled web view for showing the reflowed text. Reflowing means that the content will be more readable in different device sizes, without requiring a lot of zooming in and out, or scrolling. To inspect the CSS style applied to the web view please refer to the `pspdfkit/reader-view.css` file in the assets folder. This component is disabled by default and requires the reader view license to work.

    • Method Detail

      • isDisplayed

         boolean isDisplayed()

        Called when the activity needs to know the visibility of this view. Returns true if this view is visible, otherwise returns false.

      • doesDeviceSupportReaderView

        @UiThread() static boolean doesDeviceSupportReaderView(@NonNull() Context context)

        Checks whether PSPDFKit can show `PdfReaderView` on this device. This checks for availability of the WebView system packages. This method returns false, if the WebView package is not installed or has been disabled by the user.

        Note that this method must be called from the main thread.

        Parameters:
        context - Context used to check installed WebView packages.
        Returns:

        true if the conversion is available, false if not.

      • show

         void show()

        Shows the outline view (scroll down animation).

      • clearDocument

         void clearDocument()

        Called by the activity when the view should unbind the previously set document. This may be called in low-memory situations or prior to re-binding another document.

      • hide

         void hide()

        Hides the outline view (scroll up animation).

      • progress

         void progress(int currentPage, int totalPages)

        Reports the progress of the reflow operation, giving the current page that is being reflowed and the total number of pages that are being processed at the moment.

      • isCanceled

         boolean isCanceled()

        Returns true if the reflow operation has been canceled.