On this page
Display Modes
Scroll direction
The page scroll direction can be either horizontal
or vertical
.
If verticalMode
is true
, it indicates vertical
scrolling; otherwise, it's horizontal
scrolling.
dart
Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(),
body: CPDFReaderWidget(
document: documentPath,
configuration: CPDFConfiguration(
readerViewConfig: const ReaderViewConfig(verticalMode: true)),
onCreated: (controller) {},
));
Display Mode
The page display mode can be singlePage
, doublePage
, or coverPage
.
dart
Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(),
body: CPDFReaderWidget(
document: documentPath,
configuration: CPDFConfiguration(
readerViewConfig: const ReaderViewConfig(displayMode: CPDFDisplayMode.doublePage)),
onCreated: (controller) {},
));
Scrolling Mode
The scrolling mode can be set to continuous scrolling or page flipping mode. When continueMode
is true
, it represents continuous scrolling; otherwise, it's page flipping scrolling.
dart
Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(),
body: CPDFReaderWidget(
document: documentPath,
configuration: CPDFConfiguration(
readerViewConfig: const ReaderViewConfig(continueMode: true)),
onCreated: (controller) {},
));
Crop Mode
To display the document after cropping the blank areas around the PDF, when cropMode
is true
, it indicates enabling cropping mode; otherwise, it's not cropped.
dart
Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(),
body: CPDFReaderWidget(
document: documentPath,
configuration: CPDFConfiguration(
readerViewConfig: const ReaderViewConfig(cropMode: true)),
onCreated: (controller) {},
));