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 class
Text.Alignment
The available alignments.
-
Field Summary
Fields Modifier and Type Field Description protected Text.Alignment
m_Alignment
the alignment.protected PdfFont
m_Font
the font.protected float
m_Rotation
the rotation.protected String
m_Template
the text template.protected float
m_X
the x position.protected float
m_Y
the y position.static String
PLACEHOLDER_0PAGE
the placeholder for the 0-based page index.static String
PLACEHOLDER_1PAGE
the 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 String
alignmentTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected void
doStamp(com.itextpdf.text.pdf.PdfStamper stamper, int page)
Performs the actual stamping.String
fontTipText()
Returns the tip text for this property.Text.Alignment
getAlignment()
Returns the alignment for the text.PdfFont
getFont()
Returns the font in use.float
getRotation()
Returns the rotation for the text.String
getTemplate()
Returns the text template.float
getX()
Returns the X position for the text.float
getY()
Returns the Y position for the text.String
globalInfo()
Returns a string describing the object.String
rotationTipText()
Returns the tip text for this property.void
setAlignment(Text.Alignment value)
Sets the alignment for the text.void
setFont(PdfFont value)
Sets the font to use.void
setRotation(float value)
Sets the rotation for the text.void
setTemplate(String value)
Sets the text template.void
setX(float value)
Sets the X position for the text.void
setY(float value)
Sets the Y position for the text.String
templateTipText()
Returns the tip text for this property.String
XTipText()
Returns the tip text for this property.String
YTipText()
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:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in 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:
doStamp
in classAbstractPageRangeStamper
- Parameters:
stamper
- the stamper to usepage
- the page to apply the stamp to
-
-