Package adams.flow.transformer.pdfstamp
Class Text
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,Serializable
public class Text extends AbstractPageRangeStamper
Simple text stamper.
You can use placeholders for the page index:
- 0-based: #
- 1-based: @
Variables in the template get expanded as well.
-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-template <java.lang.String> (property: template) The text template to use for the stamp. default: Page @
-alignment <LEFT|CENTER|RIGHT> (property: alignment) The alignment of the text. default: CENTER
-font <adams.core.io.PdfFont> (property: font) The font to use for the text. default: Helvetica-Normal-12
-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
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classText.AlignmentThe available alignments.
-
Field Summary
Fields Modifier and Type Field Description protected Text.Alignmentm_Alignmentthe alignment.protected PdfFontm_Fontthe font.protected floatm_Rotationthe rotation.protected Stringm_Templatethe text template.protected floatm_Xthe x position.protected floatm_Ythe y position.static StringPLACEHOLDER_0PAGEthe placeholder for the 0-based page index.static StringPLACEHOLDER_1PAGEthe placeholder for the 1-based page index.-
Fields inherited from class adams.flow.transformer.pdfstamp.AbstractPageRangeStamper
m_Pages
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description Text()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringalignmentTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected voiddoStamp(com.itextpdf.text.pdf.PdfStamper stamper, int page)Performs the actual stamping.StringfontTipText()Returns the tip text for this property.Text.AlignmentgetAlignment()Returns the alignment for the text.PdfFontgetFont()Returns the font in use.floatgetRotation()Returns the rotation for the text.StringgetTemplate()Returns the text template.floatgetX()Returns the X position for the text.floatgetY()Returns the Y position for the text.StringglobalInfo()Returns a string describing the object.StringrotationTipText()Returns the tip text for this property.voidsetAlignment(Text.Alignment value)Sets the alignment for the text.voidsetFont(PdfFont value)Sets the font to use.voidsetRotation(float value)Sets the rotation for the text.voidsetTemplate(String value)Sets the text template.voidsetX(float value)Sets the X position for the text.voidsetY(float value)Sets the Y position for the text.StringtemplateTipText()Returns the tip text for this property.StringXTipText()Returns the tip text for this property.StringYTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.pdfstamp.AbstractPageRangeStamper
doStamp, getPages, pagesTipText, setPages
-
Methods inherited from class adams.flow.transformer.pdfstamp.AbstractStamper
check, stamp
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
PLACEHOLDER_0PAGE
public static final String PLACEHOLDER_0PAGE
the placeholder for the 0-based page index.- See Also:
- Constant Field Values
-
PLACEHOLDER_1PAGE
public static final String PLACEHOLDER_1PAGE
the placeholder for the 1-based page index.- See Also:
- Constant Field Values
-
m_Template
protected String m_Template
the text template.
-
m_Alignment
protected Text.Alignment m_Alignment
the alignment.
-
m_Font
protected PdfFont m_Font
the font.
-
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.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractPageRangeStamper
-
setTemplate
public void setTemplate(String value)
Sets the text template.- Parameters:
value- the template
-
getTemplate
public String getTemplate()
Returns the text template.- Returns:
- the template
-
templateTipText
public String templateTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAlignment
public void setAlignment(Text.Alignment value)
Sets the alignment for the text.- Parameters:
value- the alignment
-
getAlignment
public Text.Alignment getAlignment()
Returns the alignment for the text.- Returns:
- the alignment
-
alignmentTipText
public String alignmentTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFont
public void setFont(PdfFont value)
Sets the font to use.- Parameters:
value- the font
-
getFont
public PdfFont getFont()
Returns the font in use.- Returns:
- the font
-
fontTipText
public String fontTipText()
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.
-
doStamp
protected void doStamp(com.itextpdf.text.pdf.PdfStamper stamper, int page)Performs the actual stamping.- Specified by:
doStampin classAbstractPageRangeStamper- Parameters:
stamper- the stamper to usepage- the page to apply the stamp to
-
-