Guides
Reader View Config
ReaderViewConfig controls the PDF reader view's display behavior, including page layout, theme, zoom, spacing, and more.
Configuration Fields Overview
| Field | Type | Default | Description |
|---|---|---|---|
displayMode | String | "singlePage" | Page display mode |
continueMode | boolean | true | Whether to enable continuous scrolling |
verticalMode | boolean | true | Whether to scroll vertically |
cropMode | boolean | false | Whether to crop page margins |
themes | String | "light" | Reading theme |
enableSliderBar | boolean | true | Whether to show the slider progress bar |
enablePageIndicator | boolean | true | Whether to show the page indicator |
pageSpacing | int | 10 | Page spacing (dp) |
pageScale | float | 1.0 | Initial page zoom scale |
pageSameWidth | boolean | true | Whether all pages display at the same width |
enableMinScale | boolean | true | Whether to enable minimum zoom limit |
margins | int[] | [0, 0, 0, 0] | Page margins [left, top, right, bottom] |
linkHighlight | boolean | true | Whether to highlight links |
formFieldHighlight | boolean | true | Whether to highlight form fields |
annotationsVisible | boolean | true | Whether to show annotations |
enableDoubleTapZoom | boolean | false | Whether to enable double-tap zoom |
enableCreateEditTextInput | boolean | true | Whether to show input dialog when creating text in content editor mode |
enableCreateImagePickerDialog | boolean | true | Whether to show picker when creating image in content editor mode |
Page Display Mode
displayMode controls the page layout:
| Value | Description |
|---|---|
singlePage | Single page mode (default) |
doublePage | Double page mode |
coverPage | Cover mode (first page displayed alone, subsequent pages in pairs) |
json
{
"readerViewConfig": {
"displayMode": "singlePage",
"continueMode": true,
"verticalMode": true
}
}Scroll Direction
continueMode: true+verticalMode: true→ Vertical continuous scrolling (default)continueMode: true+verticalMode: false→ Horizontal continuous scrollingcontinueMode: false→ Page-by-page mode (displays one page/spread at a time)
json
{
"readerViewConfig": {
"continueMode": false,
"verticalMode": false
}
}Reading Theme
themes provides 4 built-in themes:
| Value | Description |
|---|---|
light | Light theme (default) |
dark | Dark theme |
sepia | Eye-comfort mode (warm tone) |
reseda | Green eye-comfort mode |
json
{
"readerViewConfig": {
"themes": "light"
}
}Page Spacing & Margins
json
{
"readerViewConfig": {
"pageSpacing": 10,
"margins": [0, 0, 0, 0]
}
}pageSpacing: Spacing between pages in dp.margins: Page margin array[left, top, right, bottom]in dp.
Zoom Control
json
{
"readerViewConfig": {
"pageScale": 1.0,
"pageSameWidth": true,
"enableMinScale": true,
"enableDoubleTapZoom": false
}
}| Field | Description |
|---|---|
pageScale | Initial zoom scale, 1.0 means 100% |
pageSameWidth | Whether all pages display at the same width |
enableMinScale | Whether to enable minimum zoom limit |
enableDoubleTapZoom | Whether double-tap zoom in/out is supported |
Highlights & Visibility
json
{
"readerViewConfig": {
"linkHighlight": true,
"formFieldHighlight": true,
"annotationsVisible": true,
"cropMode": false
}
}| Field | Description |
|---|---|
linkHighlight | Highlight hyperlink areas in the document |
formFieldHighlight | Highlight form field areas |
annotationsVisible | Whether to render and display annotations |
cropMode | Crop page margins and only display the content area |
UI Style Configuration
readerViewConfig.uiStyle provides fine-grained UI style control:
json
{
"readerViewConfig": {
"uiStyle": {
"selectTextColor": "#33000000",
"displayPageRect": {
"fillColor": "#4D1460F3",
"borderColor": "#6499FF",
"borderWidth": 5,
"borderDashPattern": [0.0, 0.0]
},
"screenshot": {
"outsideColor": "#00000000",
"fillColor": "#00000000",
"borderColor": "#6499FF",
"borderWidth": 5,
"borderDashPattern": [20.0, 8.0]
},
"formPreview": {
"style": "fill",
"strokeWidth": 2,
"color": "#4D1460F3"
},
"defaultBorderStyle": {
"borderColor": "#FF888888",
"borderWidth": 2,
"borderDashPattern": [10, 10]
},
"focusBorderStyle": {
"nodeColor": "#6499FF",
"borderColor": "#6499FF",
"borderWidth": 2,
"borderDashPattern": [10.0, 10.0]
}
}
}
}| Style Item | Description |
|---|---|
selectTextColor | Text selection highlight color |
displayPageRect | Border/fill style for page display area |
screenshot | Border/fill style for screenshot mode |
formPreview | Form preview style |
defaultBorderStyle | Default border style for objects |
focusBorderStyle | Border style when an object is selected |
cropImageStyle | Border style for image cropping |
Full Example
json
{
"readerViewConfig": {
"linkHighlight": true,
"formFieldHighlight": true,
"displayMode": "singlePage",
"continueMode": true,
"verticalMode": true,
"cropMode": false,
"themes": "light",
"enableSliderBar": true,
"enablePageIndicator": true,
"pageSpacing": 10,
"margins": [0, 0, 0, 0],
"pageScale": 1.0,
"pageSameWidth": true,
"enableMinScale": true,
"annotationsVisible": true,
"enableDoubleTapZoom": false
}
}