java.lang.Object
com.vaadin.flow.component.pdfviewer.Zoom
All Implemented Interfaces:
Serializable

public final class Zoom extends Object implements 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
    Modifier and Type
    Field
    Description
    static final Zoom
    Fits the whole current page into the viewer.
    static final Zoom
    Fits the width of the current page to the viewer.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    double
    Gets the factor of the actual size of the pages, see of(double).
    int
     
    static Zoom
    of(double factor)
    Creates a zoom that scales the pages relative to their actual size, for example 1 shows them at 100% and 1.5 at 150%.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PAGE_WIDTH

      public static final Zoom PAGE_WIDTH
      Fits the width of the current page to the viewer. The default zoom.
    • PAGE_FIT

      public static final Zoom PAGE_FIT
      Fits the whole current page into the viewer.
  • Method Details

    • of

      public static Zoom of(double factor)
      Creates a zoom that scales the pages relative to their actual size, for example 1 shows them at 100% and 1.5 at 150%.
      Parameters:
      factor - the factor of the actual size of the pages, greater than 0
      Returns:
      the zoom
      Throws:
      IllegalArgumentException - if the factor is not greater than 0, or not finite
    • getFactor

      public double getFactor()
      Gets the factor of the actual size of the pages, see of(double). PAGE_WIDTH and PAGE_FIT do 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 is PAGE_WIDTH or PAGE_FIT
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object