Class TextStamp


  • public class TextStamp
    extends Stamp

    A text stamp annotation

    • Method Detail

      • createRaw

        public static TextStamp createRaw​(Document targetDocument,
                                          Point topLeft,
                                          java.lang.Double height,
                                          TextStampType textType,
                                          java.lang.String text)
        Deprecated.
        Deprecated in Version 1.0. Use static method TextStamp.Create instead.

        Create a text stamp annotation.

        The width of the annotation is computed from the given stamp text. The returned text stamp annotation is not yet part of any page. It can be added to a page's list of annotations.
        Parameters:
        targetDocument - The output document with which the returned object is associated.
        topLeft - The location of the annotation's upper left corner on the page.
        height - The height of the annotation.
        textType - The text stamp type.
        text - The text to be shown in this stamp.
        Returns:
        The newly created text stamp annotation.
        Throws:
        java.lang.IllegalArgumentException - if the targetDocument has already been closed
        java.lang.IllegalArgumentException - if the targetDocument is read-only
        java.lang.IllegalArgumentException - if the textType argument is TextStampType.CUSTOM_STAMP_TEXT
        java.lang.IllegalArgumentException - if the text argument is empty
        java.lang.IllegalArgumentException - if targetDocument is null
        java.lang.IllegalArgumentException - if topLeft is null
        java.lang.IllegalArgumentException - if textType is null
        java.lang.IllegalArgumentException - if text is null
      • create

        public static TextStamp create​(Document targetDocument,
                                       Point topLeft,
                                       java.lang.Double height,
                                       TextStampType textType)

        Create a text stamp annotation.

        The width of the annotation is computed based on the given textType. The returned text stamp annotation is not yet part of any page. It can be added to a page's list of annotations.
        Parameters:
        targetDocument - The output document with which the returned object is associated.
        topLeft - The location of the annotation's upper left corner on the page.
        height - The height of the annotation.
        textType - The text stamp type.
        Returns:
        The newly created text stamp annotation.
        Throws:
        java.lang.IllegalArgumentException - if the targetDocument has already been closed
        java.lang.IllegalArgumentException - if the targetDocument is read-only
        java.lang.IllegalArgumentException - if the textType argument is TextStampType.CUSTOM_STAMP_TEXT
        java.lang.IllegalArgumentException - if targetDocument is null
        java.lang.IllegalArgumentException - if topLeft is null
        java.lang.IllegalArgumentException - if textType is null
      • getTextType

        public TextStampType getTextType()

        The displayed text (Getter)

        This defines a predefined text for this text stamp.
        Throws:
        java.lang.IllegalStateException - if the object has already been closed