Class MediaDeviceDescription

java.lang.Object
com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription

public class MediaDeviceDescription extends Object
Class that bundles all the values of a media device description.
  • Constructor Details

    • MediaDeviceDescription

      public MediaDeviceDescription (String type)
      See MediaType class constants for possible values.
      Parameters:
      type - a type of the media to use.
    • MediaDeviceDescription

      public MediaDeviceDescription (String type, float width, float height)
      Creates a new MediaDeviceDescription instance.
      Parameters:
      type - the type
      width - the width
      height - the height
  • Method Details

    • createDefault

      public static MediaDeviceDescription createDefault()
      Creates the default MediaDeviceDescription.
      Returns:
      the media device description
    • getDefault

      public static MediaDeviceDescription getDefault()
      Gets default MediaDeviceDescription instance. Do not modify any fields of the returned media device description because it may lead to unpredictable results. Use createDefault() if you want to modify device description.
      Returns:
      the default media device description
    • getType

      public String getType()
      Gets the type.
      Returns:
      the type
    • getBitsPerComponent

      public int getBitsPerComponent()
      Gets the bits per component.
      Returns:
      the bits per component
    • setBitsPerComponent

      public MediaDeviceDescription setBitsPerComponent (int bitsPerComponent)
      Sets the bits per component.
      Parameters:
      bitsPerComponent - the bits per component
      Returns:
      the media device description
    • getColorIndex

      public int getColorIndex()
      Gets the color index.
      Returns:
      the color index
    • setColorIndex

      public MediaDeviceDescription setColorIndex (int colorIndex)
      Sets the color index.
      Parameters:
      colorIndex - the color index
      Returns:
      the media device description
    • getWidth

      public float getWidth()
      Gets the width in points.
      Returns:
      the width
    • setWidth

      public MediaDeviceDescription setWidth (float width)
      Sets the width in points.
      Parameters:
      width - the width
      Returns:
      the media device description
    • getHeight

      public float getHeight()
      Gets the height in points.
      Returns:
      the height
    • setHeight

      public MediaDeviceDescription setHeight (float height)
      Sets the height in points.
      Parameters:
      height - the height
      Returns:
      the media device description
    • isGrid

      public boolean isGrid()
      Checks if the media device is a grid.
      Returns:
      true, if is grid
    • setGrid

      public MediaDeviceDescription setGrid (boolean grid)
      Sets the grid value.
      Parameters:
      grid - the grid value
      Returns:
      the media device description
    • getScan

      public String getScan()
      Gets the scan value.
      Returns:
      the scan value
    • setScan

      public MediaDeviceDescription setScan (String scan)
      Sets the scan value.
      Parameters:
      scan - the scan value
      Returns:
      the media device description
    • getOrientation

      public String getOrientation()
      Gets the orientation.
      Returns:
      the orientation
    • setOrientation

      public MediaDeviceDescription setOrientation (String orientation)
      Sets the orientation.
      Parameters:
      orientation - the orientation
      Returns:
      the media device description
    • getMonochrome

      public int getMonochrome()
      Gets the number of bits per pixel on a monochrome (greyscale) device.
      Returns:
      the number of bits per pixel on a monochrome (greyscale) device
    • setMonochrome

      public MediaDeviceDescription setMonochrome (int monochrome)
      Sets the number of bits per pixel on a monochrome (greyscale) device.
      Parameters:
      monochrome - the number of bits per pixel on a monochrome (greyscale) device
      Returns:
      the media device description
    • getResolution

      public float getResolution()
      Gets the resolution in DPI.
      Returns:
      the resolution
    • setResolution

      public MediaDeviceDescription setResolution (float resolution)
      Sets the resolution in DPI.
      Parameters:
      resolution - the resolution
      Returns:
      the media device description