iOS
ComPDFKit PDF SDK
Guides

Viewer

 

The viewer is a viewing and rasterization scroll view component that handles a number of viewing operations including rendering, caching, high level zoom rendering and layout modes. It offers developers a way to quickly embed a highly configurable PDF viewer in any Android application.

 

Display Modes             

 

Scroll direction

When scrolling through pages of a document in CPDFView, the scrolling direction can be changed by setting the page display direction.

 

- Vertical scrolling mode (also known as continuous mode) can be enabled by setting the page display direction to CPDFDisplayDirectionVertical.

 

pdfView.displayDirection = CPDFDisplayDirectionVertical;

 

- Horizontal scrolling mode (also known as non-continuous mode) can be enabled by setting the page display direction to CPDFDisplayDirectionHorizontal.

 

pdfView.displayDirection = CPDFDisplayDirectionHorizontal;

 

You also can configure the scroll direction of CPDFView in CPDFKitConfig.

 

CPDFKitShareConfig.displayDirection = CPDFDisplayDirectionVertical;

 

Two-up mode

Displays two pages side-by-side.

 

pdfView.displayTwoUp = YES;

 

Cover mode

Show cover page during two-up.

 

pdfView.displayTwoUp = YES;
pdfView.displaysAsBook = YES;

 

Crop mode

Automatically trim PDF files white margins to resize pages. Crop mode can be enabled by setting the page display crop to Yes.

 

pdfView.displayCrop = YES;

 

Note: You must call layoutDocumentView method explicitly if using these CPDFView properties (displayDirection, displaysPageBreaks, pageBreakMargins, displayTwoUp, displaysAsBook, displayCrop).