public class

PdfReaderView

extends FrameLayout
implements PSPDFKitViews.PSPDFView
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.pspdfkit.ui.PdfReaderView

Class Overview

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.

Summary

[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
PdfReaderView(Context context)
PdfReaderView(Context context, AttributeSet attrs)
PdfReaderView(Context context, AttributeSet attrs, int defStyleAttr)
PdfReaderView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
void addOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Register a listener that would like to receive visibility change events.
void clearDocument()
Called by the activity when the view should unbind the previously set document.
static boolean doesDeviceSupportReaderView(Context context)
Checks whether PSPDFKit can show `PdfReaderView` on this device.
PSPDFKitViews.Type getPSPDFViewType()
Returns the type of this view.
void hide()
Hides the outline view (scroll up animation).
boolean isDisplayed()
Called when the activity needs to know the visibility of this view.
void removeOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Unregister a previously registered listener that no longer wants to receive visibility change events.
void setDocument(PdfDocument document, PdfConfiguration configuration)
Called when the document has been loaded and is going to be displayed.
void show()
Shows the outline view (scroll down animation).
Protected Methods
boolean fitSystemWindows(Rect insets)
void onAttachedToWindow()
void onDetachedFromWindow()
void onDraw(Canvas canvas)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.pspdfkit.ui.PSPDFKitViews.PSPDFView

Public Constructors

public PdfReaderView (Context context)

public PdfReaderView (Context context, AttributeSet attrs)

public PdfReaderView (Context context, AttributeSet attrs, int defStyleAttr)

public PdfReaderView (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public Methods

public void addOnVisibilityChangedListener (OnVisibilityChangedListener listener)

Register a listener that would like to receive visibility change events. Whenever the visibility of a managed PSPDFKitViews.PSPDFView changes, all registered listeners will be notified.

Parameters
listener Listener to be added.

public 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.

public static boolean doesDeviceSupportReaderView (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.
Throws
IllegalStateException if not called from the main thread.

public PSPDFKitViews.Type getPSPDFViewType ()

Returns the type of this view.

Returns

public void hide ()

Hides the outline view (scroll up animation).

public boolean isDisplayed ()

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

public void removeOnVisibilityChangedListener (OnVisibilityChangedListener listener)

Unregister a previously registered listener that no longer wants to receive visibility change events.

Parameters
listener Listener to be removed.

public void setDocument (PdfDocument document, PdfConfiguration configuration)

Called when the document has been loaded and is going to be displayed. This has to be called on the main thread.

Parameters
document Loaded PdfDocument.
configuration Containing document and presentation settings.

public void show ()

Shows the outline view (scroll down animation).

Protected Methods

protected boolean fitSystemWindows (Rect insets)

protected void onAttachedToWindow ()

protected void onDetachedFromWindow ()

protected void onDraw (Canvas canvas)

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)