Skip to content
Guides

Display Modes

ComPDFKit supports single-page, double-page, and book mode arrangements for documents, facilitating reading through both page flipping and scrolling methods. Additionally, it offers options to set cropping mode and view mode.

Set the Display Mode

This example shows how to set the display mode to single continuous:

java
readerView.setDoublePageMode(false);
readerView.setContinueMode(true);

Explanation of Display Mode Types

The code to set the scrolling direction is as follows:

java
// Vertical scrolling.
readerView.setVerticalMode(true);
// Horizontal scrolling.
readerView.setVerticalMode(false);

The code to set the single-page or double-page mode is as follows:

java
// Double-page display.
readerView.setDoublePageMode(true);
// Single-page display.
readerView.setDoublePageMode(false);

The code to set whether continuous scrolling is needed is as follows:

java
readerView.setContinueMode(true);

The code to set whether it is in book mode is as follows:

java
readerView.setDoublePageMode(true);
readerView.setCoverPageMode(true);

Set the Crop Mode

Crop mode refers to a feature in PDF documents that allows the cropping of pages to alter their visible area or dimensions. Crop mode enables users to define the display range of a page, making it visually more aligned with specific requirements.

This example shows how to set the crop mode:

java
readerView.setCropMode(true);

Set the View Mode

When using CPDFReaderView, you may have different business scenarios, such as reading mode, annotation editing mode, document editing mode, etc. Depending on the specific use case, you can achieve your requirements by using the readerView.setViewMode(ViewMode viewMode) method.

View Modedescription
VIEW- Supports form filling
- Does not support annotation addition, selection, movement, deletion, or attribute editing
- Does not support form addition, selection, movement, deletion, or attribute editing
FORM- Supports form addition, selection, movement, deletion, and attribute editing
- Does not support annotation addition, selection, movement, deletion, or attribute editing
- Does not support form filling
PDFEDIT- Supports document text and image addition, selection, movement, deletion, and attribute editing
- Does not support annotation addition, selection, movement, deletion, or attribute editing
- Does not support form filling
- Does not support form addition, selection, movement, deletion, or attribute editing
ALL- Supports form addition, selection, movement, deletion, and attribute editing
- Supports annotation addition, selection, movement, deletion, and attribute editing
- Does not support form filling
- Does not support document text and image editing