Skip to content
Guides

Zooming

Set the default zoom factor for displaying the PDF document, which defaults to 1.0 and is limited to the range of 1.0 to 5.0.

tsx
let config = ComPDFKit.getDefaultConfig({
  readerViewConfig: {
    pageScale: 1.0
  }
});
ComPDFKit.openDocument(samplePDF, '', config);

// CPDFReaderView Sample
<CPDFReaderView
    ref={pdfReaderRef}
    document={samplePDF}
    saveDocument={saveDocument}
    configuration={config}/>

Set the zoom level via the API:

tsx
await pdfReaderRef.current?.setScale(2.0);