Class AnnotationOptions

java.lang.Object
com.ironsoftware.ironpdf.annotation.AnnotationOptions

public class AnnotationOptions extends Object
Class used to configure annotations to a PdfDocument.

See: AnnotationManager

See: PdfDocument.getAnnotation()

  • Constructor Summary

    Constructors
    Constructor
    Description
    Adds an annotation to a page of this PdfDocument
    AnnotationOptions(String title, String contents, int x, int y)
    Adds an annotation to a page of this PdfDocument
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets contents.
    int
    Gets height of your annotation's icon and interactive area in pixels.
    Gets AnnotationIcon used to display the interactive annotation within the PDF.
    double
    Gets the opacity of the annotation (valid values are from 0.0 to 1.0).
    Gets color of the annotation's background 'sticky note' using Html color notation.
    Gets subject or 'subheading' of the annotation.
    Gets title.
    int
    Gets width of your annotation's icon and interactive area in pixels.
    int
    Gets the horizontal X position of the annotation on your page in pixels.
    int
    Gets the vertical Y position of the annotation on your page in pixels.
    boolean
    Gets a flag that hides the annotation from users.
    boolean
    Gets a flag for annotation to be opened and readable by default, without user interaction.
    boolean
    Gets a flag that the annotation render during user PDF printing operations..
    boolean
    Gets a flag that makes the annotation readonly.
    boolean
    Gets a flag that allows the annotation to be rotated.
    void
    Sets contents.
    void
    setHeight(int value)
    Sets height of your annotation's icon and interactive area in pixels.
    void
    setHidden(boolean value)
    Sets a flag that hides the annotation from users.
    void
    Sets AnnotationIcon used to display the interactive annotation within the PDF.
    void
    setOpacity(double value)
    Sets the opacity of the annotation (valid values are from 0.0 to 1.0).
    void
    setOpen(boolean value)
    Sets a flag for annotation to be opened and readable by default, without user interaction.
    void
    setPrintable(boolean value)
    Sets a flag that the annotation render during user PDF printing operations..
    void
    setReadonly(boolean value)
    Sets a flag that makes the annotation readonly.
    void
    Sets the color of the annotation's background 'sticky note' using Html color notation.
    void
    setRotateable(boolean value)
    Sets A flag that allows the annotation to be rotated.
    void
    Sets subject or 'subheading' of the annotation.
    void
    Sets title.
    void
    setWidth(int value)
    Sets width of your annotation's icon and interactive area in pixels.
    void
    setX(int value)
    Sets horizontal X position of the annotation on your page in pixels.
    void
    setY(int value)
    Sets the vertical Y position of the annotation on your page in pixels.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AnnotationOptions

      public AnnotationOptions(String title, String contents, int x, int y)
      Adds an annotation to a page of this PdfDocument
      Parameters:
      title - The title of the annotation
      contents - The text content of the annotation
      x - The horizontal X position of the annotation on your page in pixels
      y - The vertical Y position of the annotation on your page in pixels. Measured from bottom upwards.
    • AnnotationOptions

      public AnnotationOptions(String contents)
      Adds an annotation to a page of this PdfDocument
      Parameters:
      contents - the text content of the annotation
  • Method Details

    • getTitle

      public String getTitle()
      Gets title.
      Returns:
      the title
    • setTitle

      public void setTitle(String value)
      Sets title.
      Parameters:
      value - the value
    • getSubject

      public String getSubject()
      Gets subject or 'subheading' of the annotation.
      Returns:
      the subject
    • setSubject

      public void setSubject(String value)
      Sets subject or 'subheading' of the annotation.
      Parameters:
      value - The value
    • getContents

      public String getContents()
      Gets contents.
      Returns:
      the contents
    • setContents

      public void setContents(String value)
      Sets contents.
      Parameters:
      value - the value
    • getX

      public int getX()
      Gets the horizontal X position of the annotation on your page in pixels.
      Returns:
      the horizontal X position of the annotation on your page in pixels
    • setX

      public void setX(int value)
      Sets horizontal X position of the annotation on your page in pixels.
      Parameters:
      value - the x value
    • getY

      public int getY()
      Gets the vertical Y position of the annotation on your page in pixels. Measured from bottom upwards.
      Returns:
      the vertical Y position of the annotation on your page in pixels. Measured from bottom upwards.
    • setY

      public void setY(int value)
      Sets the vertical Y position of the annotation on your page in pixels. Measured from bottom upwards.
      Parameters:
      value - the y value
    • getWidth

      public int getWidth()
      Gets width of your annotation's icon and interactive area in pixels.
      Returns:
      the width of your annotation's icon and interactive area in pixels
    • setWidth

      public void setWidth(int value)
      Sets width of your annotation's icon and interactive area in pixels.
      Parameters:
      value - the value
    • getHeight

      public int getHeight()
      Gets height of your annotation's icon and interactive area in pixels.
      Returns:
      the height of your annotation's icon and interactive area in pixels
    • setHeight

      public void setHeight(int value)
      Sets height of your annotation's icon and interactive area in pixels.
      Parameters:
      value - the value
    • getIcon

      public AnnotationIcon getIcon()
      Gets AnnotationIcon used to display the interactive annotation within the PDF.
      Returns:
      the AnnotationIcon used to display the interactive annotation within the PDF
    • setIcon

      public void setIcon(AnnotationIcon value)
      Sets AnnotationIcon used to display the interactive annotation within the PDF.
      Parameters:
      value - the AnnotationIcon
    • isOpen

      public boolean isOpen()
      Gets a flag for annotation to be opened and readable by default, without user interaction.
      Returns:
      a flag for annotation to be opened and readable by default, without user interaction
    • setOpen

      public void setOpen(boolean value)
      Sets a flag for annotation to be opened and readable by default, without user interaction.
      Parameters:
      value - a flag for annotation to be opened and readable by default, without user interaction. Default is true.
    • isReadonly

      public boolean isReadonly()
      Gets a flag that makes the annotation readonly. Default is true.
      Returns:
      a flag that makes the annotation readonly. Default is true.
    • setReadonly

      public void setReadonly(boolean value)
      Sets a flag that makes the annotation readonly. Default is true.
      Parameters:
      value - a flag that makes the annotation readonly. Default is true.
    • isPrintable

      public boolean isPrintable()
      Gets a flag that the annotation render during user PDF printing operations..
      Returns:
      a flag that the annotation render during user PDF printing operations.
    • setPrintable

      public void setPrintable(boolean value)
      Sets a flag that the annotation render during user PDF printing operations..
      Parameters:
      value - a flag that the annotation render during user PDF printing operations.
    • getRgbColor

      public String getRgbColor()
      Gets color of the annotation's background 'sticky note' using Html color notation. E.g. '#FFFF33'.
      Returns:
      the color of the annotation's background 'sticky note' using Html color notation. E.g. '#FFFF33'.
    • setRgbColor

      public void setRgbColor(String value)
      Sets the color of the annotation's background 'sticky note' using Html color notation. E.g. '#FFFF33'.
      Parameters:
      value - the color of the annotation's background 'sticky note' using Html color notation. E.g. '#FFFF33'.
    • getOpacity

      public double getOpacity()
      Gets the opacity of the annotation (valid values are from 0.0 to 1.0).
      Returns:
      the opacity of the annotation (valid values are from 0.0 to 1.0)
    • setOpacity

      public void setOpacity(double value)
      Sets the opacity of the annotation (valid values are from 0.0 to 1.0).
      Parameters:
      value - the opacity of the annotation (valid values are from 0.0 to 1.0).
    • isHidden

      public boolean isHidden()
      Gets a flag that hides the annotation from users. Default is false..
      Returns:
      a flag that hides the annotation from users. Default is false.
    • setHidden

      public void setHidden(boolean value)
      Sets a flag that hides the annotation from users. Default is false..
      Parameters:
      value - a flag that hides the annotation from users. Default is false.
    • isRotateable

      public boolean isRotateable()
      Gets a flag that allows the annotation to be rotated. E.g. when the containing page os rotated. Default is false..
      Returns:
      a flag that allows the annotation to be rotated. E.g. when the containing page os rotated. Default is false.
    • setRotateable

      public void setRotateable(boolean value)
      Sets A flag that allows the annotation to be rotated. E.g. when the containing page os rotated. Default is false..
      Parameters:
      value - a flag that allows the annotation to be rotated. E.g. when the containing page os rotated. Default is false.