PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Page zoom controls the display scale of a PDF inside the viewer. Zoom configuration is commonly used in the following scenarios:
This page focuses on programmatic zoom configuration and the basic double-tap zoom setting.
Zoom configuration is commonly needed in the following cases:
CPDFReaderView supports setting the current page zoom ratio directly through setScale(...).
readerView.setScale(5);This code sets the viewer to a 5x display scale.
If the screen must enter a specific magnification level right after the document is shown, this method is usually called after the document is bound and the viewer becomes interactive.
If the viewer should keep double-tap zoom interaction, enable setEnableDoubleClickScale(...).
readerView.setEnableDoubleClickScale(true);After it is enabled, double-tapping the page changes the display scale according to the SDK's current zoom behavior.
Zoom configuration is often used together with the default reading mode. For example, a document can enter a specific display mode first, then apply a zoom ratio, while still keeping double-tap zoom interaction.
readerView.setScale(5);
readerView.setEnableDoubleClickScale(true);This combination is suitable for screens that need magnified reading detail while still preserving standard reading gestures.
setScale(...) changes the current viewer display scale. It does not modify the PDF file on disk.