Class Zoom
java.lang.Object
com.vaadin.flow.component.pdfviewer.Zoom
- All Implemented Interfaces:
Serializable
The zoom level of the pages of
PdfViewer: PAGE_WIDTH,
PAGE_FIT, or a factor of the actual size of the pages, see
of(double).- Since:
- 25.4
- Author:
- Vaadin Ltd
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleandoubleGets the factor of the actual size of the pages, seeof(double).inthashCode()static Zoomof(double factor) Creates a zoom that scales the pages relative to their actual size, for example1shows them at 100% and1.5at 150%.
-
Field Details
-
PAGE_WIDTH
Fits the width of the current page to the viewer. The default zoom. -
PAGE_FIT
Fits the whole current page into the viewer.
-
-
Method Details
-
of
Creates a zoom that scales the pages relative to their actual size, for example1shows them at 100% and1.5at 150%.- Parameters:
factor- the factor of the actual size of the pages, greater than0- Returns:
- the zoom
- Throws:
IllegalArgumentException- if the factor is not greater than0, or not finite
-
getFactor
public double getFactor()Gets the factor of the actual size of the pages, seeof(double).PAGE_WIDTHandPAGE_FITdo not have a factor, so compare the zoom with them before calling this method.- Returns:
- the factor, greater than
0 - Throws:
IllegalStateException- if this zoom isPAGE_WIDTHorPAGE_FIT
-
equals
-
hashCode
public int hashCode()
-