com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class TextStamp

  • Direct Known Subclasses:
    PageNumberStamp


    public class TextStamp
    extends Stamp

    Reresents textual stamp.

    • Field Detail

      • DefaultFontSize

        public static final float DefaultFontSize
        Default Font Size
        See Also:
        Constant Field Values
    • Constructor Detail

      • TextStamp

        public TextStamp(String value)

        Initializes a new instance of the TextStamp class.

        Parameters:
        value - Stamp value.
      • TextStamp

        public TextStamp(FormattedText formattedText)

        Initializes a new instance of the TextStamp class with formattedText object

        Parameters:
        formattedText - FormattedText object which contains text of the stamp.
    • Method Detail

      • getDraw

        public boolean getDraw()

        This property determines how stamp is drawn on page. If Draw = true stamp is drawn as graphic operators and if draw = false then stamp is drawn as text.

        Returns:
        boolean value
      • setDraw

        public void setDraw(boolean value)

        This property determines how stamp is drawn on page. If Draw = true stamp is drawn as graphic operators and if draw = false then stamp is drawn as text.

        Parameters:
        value - boolean value
      • getTreatYIndentAsBaseLine

        public boolean getTreatYIndentAsBaseLine()

        Defines coordinate origin for placing text. If TreatYIndentAsBaseLine = true (default when Draw = true) YIndent value will be treated as text base line. If TreatYIndentAsBaseLine = false (default when Draw = false) YIndent value will be treated as bottom (descent line) of text.

        Returns:
        boolean value
      • setTreatYIndentAsBaseLine

        public void setTreatYIndentAsBaseLine(boolean value)

        Defines coordinate origin for placing text. If TreatYIndentAsBaseLine = true (default when Draw = true) YIndent value will be treated as text base line. If TreatYIndentAsBaseLine = false (default when Draw = false) YIndent value will be treated as bottom (descent line) of text.

        Parameters:
        value - boolean value
      • isWordWrap

        public boolean isWordWrap()

        Defines word wrap. If this property set to true and Width value specified, text will be broken in the several lines to fit into specified width. Default value: false.

        Returns:
        boolean value
      • setWordWrap

        public void setWordWrap(boolean value)

        Defines word wrap. If this property set to true and Width value specified, text will be broken in the several lines to fit into specified width. Default value: false.

        Parameters:
        value - boolean value
      • isJustify

        public boolean isJustify()

        Defines text justification. If this property is set to true, both left and right edges of the text are aligned. Default value: false.

        Returns:
        boolean value
      • setJustify

        public void setJustify(boolean value)

        Defines text justification. If this property is set to true, both left and right edges of the text are aligned. Default value: false.

        Parameters:
        value - boolean value
      • isScale

        public boolean isScale()

        Defines scaling of the text. If this property is set to true and Width value specified, text will be scaled in order to fit to specified width.

        Returns:
        boolean value
      • setScale

        public void setScale(boolean value)

        Defines scaling of the text. If this property is set to true and Width value specified, text will be scaled in order to fit to specified width.

        Parameters:
        value - boolean value
      • getDefaultFont

        public static Font getDefaultFont()
        Returns default font
        Returns:
        com.aspose.pdf.Font object
      • getValue

        public String getValue()

        Gets string value which is used as stamp on the page.

        Returns:
        String value
      • setValue

        public void setValue(String value)

        Sets string value which is used as stamp on the page.

        Parameters:
        value - String value
      • getTextState

        public TextState getTextState()

        Gets text properties of the stamp. See TextState for details.

        Returns:
        TextState element
      • getTextAlignment

        public int getTextAlignment()

        Alignment of the text inside the stamp.

        Returns:
        HorizontalAlignment value
        See Also:
        HorizontalAlignment
      • setTextAlignment

        public void setTextAlignment(int value)

        Alignment of the text inside the stamp.

        Parameters:
        value - HorizontalAlignment value
        See Also:
        HorizontalAlignment
      • put

        public void put(Page page)

        Adds textual stamp on the page.

        Specified by:
        put in class Stamp
        Parameters:
        page - Page for stamping.
      • getWidth

        public double getWidth()

        Desired width of the stamp on the page.

        Overrides:
        getWidth in class Stamp
        Returns:
        double value
      • setWidth

        public void setWidth(double value)

        Desired width of the stamp on the page.

        Overrides:
        setWidth in class Stamp
        Parameters:
        value - double value
      • getHeight

        public double getHeight()

        Desired height of the stamp on the page.

        Overrides:
        getHeight in class Stamp
        Returns:
        double value
      • setHeight

        public void setHeight(double value)

        Desired height of the stamp on the page.

        Overrides:
        setHeight in class Stamp
        Parameters:
        value - double value
      • getMaxRowWidth

        public double getMaxRowWidth()

        Max row height for WordWrap option.

        Returns:
        double value
      • setMaxRowWidth

        public void setMaxRowWidth(double value)

        Max row height for WordWrap option.

        Parameters:
        value - double value