Class Image

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, SizeOfHandler, Serializable

    public class Image
    extends AbstractPageRangeStamper
    Places the image at the specified location.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -pages <adams.core.Range> (property: pages)
        The pages to stamp.
        default: first-last
        example: A range is a comma-separated list of single 1-based indices or sub-ranges of indices ('start-end'); 'inv(...)' inverts the range '...'; the following placeholders can be used as well: first, second, third, last_2, last_1, last
     
    -image <adams.core.io.PlaceholderFile> (property: image)
        The image to use as stamp.
        default: ${CWD}
     
    -x <float> (property: X)
        The X position.
        default: 0.0
        minimum: 0.0
     
    -y <float> (property: Y)
        The Y position.
        default: 0.0
        minimum: 0.0
     
    -rotation <float> (property: rotation)
        The rotation in degrees, counterclockwise.
        default: 0.0
        minimum: 0.0
        maximum: 360.0
     
    -scale <float> (property: scale)
        The scaling factor for the image, ie, scaling it to the page dimensions; 
        use 0 to turn scaling off.
        default: 1.0
        minimum: 0.0
        maximum: 1.0
     
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_X

        protected float m_X
        the x position.
      • m_Y

        protected float m_Y
        the y position.
      • m_Rotation

        protected float m_Rotation
        the rotation.
      • m_Scale

        protected float m_Scale
        the percentage (0-1) to scale the images to.
    • Constructor Detail

      • Image

        public Image()
    • Method Detail

      • setImage

        public void setImage​(PlaceholderFile value)
        Sets the image to insert.
        Parameters:
        value - the image filename
      • getImage

        public PlaceholderFile getImage()
        Returns the image to insert.
        Returns:
        the image filename
      • imageTipText

        public String imageTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setX

        public void setX​(float value)
        Sets the X position for the text.
        Parameters:
        value - the x position
      • getX

        public float getX()
        Returns the X position for the text.
        Returns:
        the x position
      • XTipText

        public String XTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setY

        public void setY​(float value)
        Sets the Y position for the text.
        Parameters:
        value - the y position
      • getY

        public float getY()
        Returns the Y position for the text.
        Returns:
        the y position
      • YTipText

        public String YTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setRotation

        public void setRotation​(float value)
        Sets the rotation for the text.
        Parameters:
        value - the rotation (degrees counterclockwise)
      • getRotation

        public float getRotation()
        Returns the rotation for the text.
        Returns:
        the rotation (degrees counterclockwise)
      • rotationTipText

        public String rotationTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setScale

        public void setScale​(float value)
        Sets the scale factor (0-1) for images based on the page size.
        Parameters:
        value - the scale factor, 0 to turn off scaling
      • getScale

        public float getScale()
        Returns the scale factor (0-1) for images based on the page size.
        Returns:
        the scale factor
      • scaleTipText

        public String scaleTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • doStamp

        protected void doStamp​(com.itextpdf.text.pdf.PdfStamper stamper,
                               int page)
        Performs the actual stamping.
        Specified by:
        doStamp in class AbstractPageRangeStamper
        Parameters:
        stamper - the stamper to use
        page - the page to apply the stamp to