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 PSPDFPageTransitionScrollPerSpread

The are no constraints:

Copy
1
2
3
4
5
6
let configuration = PSPDFConfiguration { builder in
	// When the page transition is scrollPerPage
	builder.pageTransition = .scrollPerSpread
	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 PSPDFPageTransitionScrollPerSpread
	builder.pageTransition = PSPDFPageTransitionScrollPerSpread;
	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 only be honored if scrollDirection is .vertical. It will forced to single otherwise.
}
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 will only be honored if scrollDirection is PSPDFScrollDirectionVertical. It will forced to PSPDFPageModeSingle otherwise.
}];

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
}];