Document Presentation Options


You can configure the page transition, scroll direction and the scroll mode in PSPDFConfiguration (see the PSPDFConfiguration guide for more information).

In SettingsExample from the catalog app, you'll see a complete example of how these properties interact together in the context of a PSPDFSettingsViewController. A PSPDFSettingsViewController is used to change key UX settings that are configurable via the PSPDFConfiguration.settingsOptions property.

You need to be aware of the following constraints when using these PSPDFConfiguration properties (pageTransition, scrollDirection and pageMode) simultaneously.

If the page transition is PSPDFPageTransitionScrollPerPage

The are no constraints:

Copy
1
2
3
4
5
6
let configuration = PSPDFConfiguration { builder in
    // When the page transition is scrollPerPage
    builder.pageTransition = .scrollPerPage
    builder.scrollDirection = .vertical // Can also be .horizontal
    builder.pageMode = .single // Can also be .double or .automatic
}
Copy
1
2
3
4
5
6
PSPDFConfiguration *configuration = [PSPDFConfiguration configurationWithBuilder:^(PSPDFConfigurationBuilder *builder) {
    // When the page transition is PSPDFPageTransitionScrollPerPage
    builder.pageTransition = PSPDFPageTransitionScrollPerPage;
    builder.scrollDirection = PSPDFScrollDirectionVertical; // Can also be PSPDFScrollDirectionHorizontal
    builder.pageMode = PSPDFPageModeSingle; // Can also be PSPDFPageModeDouble or PSPDFPageModeAutomatic
}];

If the page transition is PSPDFPageTransitionScrollContinuous

Copy
1
2
3
4
5
6
let configuration = PSPDFConfiguration { builder in
    // When the page transition is scrollContinuous
    builder.pageTransition = .scrollContinuous
    builder.scrollDirection = .vertical // Can also be .horizontal
    builder.pageMode = .single // Setting a value to pageMode will be ignored. It will forced to single.
}
Copy
1
2
3
4
5
6
PSPDFConfiguration *configuration = [PSPDFConfiguration configurationWithBuilder:^(PSPDFConfigurationBuilder *builder) {
    // When the page transition is PSPDFPageTransitionScrollContinuous
    builder.pageTransition = PSPDFPageTransitionScrollContinuous;
    builder.scrollDirection = PSPDFScrollDirectionVertical; // Can also be PSPDFScrollDirectionHorizontal
    builder.pageMode = PSPDFPageModeSingle; // Setting a value to`pageMode` property will be ignored. It will forced to PSPDFPageModeSingle.
}];

If the page transition is PSPDFPageTransitionCurl

Copy
1
2
3
4
5
6
let configuration = PSPDFConfiguration { builder in
    // When the page transition is curl
    builder.pageTransition = .curl
    builder.scrollDirection = .horizontal // Setting a value to scrollDirection property will be ignored. It will forced to .horizontal.
    builder.pageMode = .single // Can also be .double or .automatic
}
Copy
1
2
3
4
5
6
PSPDFConfiguration *configuration = [PSPDFConfiguration configurationWithBuilder:^(PSPDFConfigurationBuilder *builder) {
    // When the page transition is PSPDFPageTransitionCurl
    builder.pageTransition = PSPDFPageTransitionCurl;
    builder.scrollDirection = PSPDFScrollDirectionHorizontal; // Setting a value to scrollDirection property will be ignored. It will forced to PSPDFScrollDirectionHorizontal.
        builder.pageMode = PSPDFPageModeSingle; // Can also be PSPDFPageModeDouble or PSPDFPageModeAutomatic
}];
Was this page helpful? We're happy to answer any questions.