Page Layout Options in Our UWP Viewer

PSPDFKit for Windows offers a rich GUI environment. This provides a great end user experience, but sometimes developers need programmatic control of these moving parts.

Changing the Layout Mode

Different documents and devices require the layout of a page to appear differently onscreen. It’s possible to control this layout mode programmatically rather than letting the user decide.

This example shows how to set the layout mode to double width:

await pdfView.Controller.SetLayoutModeAsync(LayoutMode.Double);

Keeping the First Spread as a Single Page

In double-page spread layout mode, the title page or first page will appear next to the second page. Aesthetically, this may not be as pleasing to the eye as a standalone title page. This is often true for magazines that want to show a cover page before the regular content starts.

To set the first page to show as a single page, you can write the following:

await pdfView.Controller.SetKeepFirstSpreadAsSinglePageAsync(true);