Document Presentation Options

PSPDFKit offers many ways to present your documents, and this guide article will give you an overview of the available options. You can configure the page transition, scroll direction, and scroll mode in PdfConfiguration. You can also configure them inside the PdfActivity using the SettingsModePicker.

You need to be aware of the following constraints when using these PdfConfiguration properties (scrollMode, scrollDirection, and layoutMode) simultaneously.

PageScrollMode#PER_PAGE

If the scroll mode is PageScrollMode#PER_PAGE, there are no constraints:

  • The scrollDirection property can be either PageScrollDirection#HORIZTONTAL or PageScrollDirection#VERTICAL.
  • The layoutMode property can be PageLayoutMode#SINGLE, PageLayoutMode#DOUBLE, or PageLayoutMode#AUTO.
Copy
1
2
3
4
5
val configuration = PdfActivityConfiguration.Builder(context)
    .scrollMode(PageScrollMode.PER_PAGE)
    .scrollDirection(PageScrollDirection.VERTICAL) // Can also be HORIZONTAL.
    .layoutMode(PageLayoutMode.SINGLE) // Can also be DOUBLE, or AUTO.
    .build()
Copy
1
2
3
4
5
PdfActivityConfiguration configuration = new PdfActivityConfiguration.Builder(context)
    .scrollMode(PageScrollMode.PER_PAGE)
    .scrollDirection(PageScrollDirection.VERTICAL) // Can also be HORIZONTAL.
    .layoutMode(PageLayoutMode.SINGLE) // Can also be DOUBLE, or AUTO.
    .build();

PageScrollMode#CONTINUOUS

If the scroll mode is PageScrollMode#CONTINUOUS:

  • The scrollDirection property can be either PageScrollDirection#HORIZTONTAL or PageScrollDirection#VERTICAL.
  • The layoutMode property can only be PageLayoutMode#SINGLE; setting other values has no effect and will default to PageLayoutMode#SINGLE.
Copy
1
2
3
4
5
val configuration = PdfActivityConfiguration.Builder(context)
    .scrollMode(PageScrollMode.CONTINUOUS)
    .scrollDirection(PageScrollDirection.VERTICAL) // Can also be HORIZONTAL.
    .layoutMode(PageLayoutMode.SINGLE) // This will always be forced to SINGLE.
    .build()
Copy
1
2
3
4
5
PdfActivityConfiguration configuration = new PdfActivityConfiguration.Builder(context)
    .scrollMode(PageScrollMode.CONTINUOUS)
    .scrollDirection(PageScrollDirection.VERTICAL) // Can also be HORIZONTAL.
    .layoutMode(PageLayoutMode.SINGLE) // This will always be forced to SINGLE.
    .build();