DImuthuUpe / AndroidPdfViewer

Android view for displaying PDFs rendered with PdfiumAndroid
Apache License 2.0
8.12k stars 1.89k forks source link

Disable pinch to zoom #347

Open yohann84L opened 7 years ago

yohann84L commented 7 years ago

Is there any way to disable pinch to zoom ? I don't want users to zoom in or out on the PDF.

1stmetro commented 7 years ago

Overwrite the function basically

bonyhardian commented 4 years ago

Add this code in onCreate: Constants.Pinch.MINIMUM_ZOOM = 1; Constants.Pinch.MAXIMUM_ZOOM = 1;

For disable double tap: pdfView.fromAsset(SAMPLE_FILE) ....... .enableDoubletap(false) .load();

Ziriac commented 4 years ago

Another possibility is to change the zoom when you create the view :

pdfView.setMaxZoom(Constants.Pinch.MINIMUM_ZOOM); pdfView.setMidZoom(Constants.Pinch.MINIMUM_ZOOM);

That way you don't have to change the Constants.

dwbdwbdwb commented 3 years ago

另一种可能性是在创建视图时更改缩放:

pdfView.setMaxZoom(Constants.Pinch.MINIMUM_ZOOM); pdfView.setMidZoom(Constants.Pinch.MINIMUM_ZOOM);

这样,您不必更改常量。

effect is wrong