Skip to content
Guides

Display Modes

ComPDFKit supports single-page, double-page, and book mode arrangements for documents, facilitating reading through both page flipping and scrolling methods. Additionally, it offers options to set cropping mode.

Set the Display Mode

This example shows how to set the display mode to single continuous:

swift
var pdfview = CPDFView()
pdfview.displayTwoUp = false
pdfview.displaysAsBook = false
pdfview.layoutDocumentView()
objective-c
CPDFView pdfview;
pdfview.displayTwoUp = NO;
pdfview.displaysAsBook = NO;
[pdfview layoutDocumentView];

Explanation of Display Mode Types

The table below displays Reading Mode types, descriptions, and their corresponding parameter names.

TypeDescriptionParameter Name
Page continuousSet whether to add spacing between adjacent pages.pdfview.displaysPageBreaks
DoubleSet whether to display two pages of the document side by side.pdfview.displayTwoUp
BookSet whether to have the cover occupy a separate line in double-page mode.pdfview.displaysAsBook
Scrolling DirectionSet whether to use vertical scrolling or horizontal scrolling.pdfView.displayDirection

Set the Crop Mode

Crop mode refers to a feature in PDF documents that allows the cropping of pages to alter their visible area or dimensions. Crop mode enables users to define the display range of a page, making it visually more aligned with specific requirements.

This example shows how to set the crop mode:

swift
var pdfview = CPDFView()
pdfview.displayCrop = true
pdfview.layoutDocumentView()
objective-c
CPDFView pdfview;
pdfview.displayCrop = YES;
[pdfview layoutDocumentView];