public class PDFTextFormat
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
PDFTextFormat()
create a new PDFTextFormat, with initial values
|
Modifier and Type | Method and Description |
---|---|
void |
carriageReturn()
perform a carriage return
|
void |
carriageReturn(float x,
float y)
perform a carriage return by translating by x and y.
|
java.lang.Object |
clone()
Clone the text format
|
void |
doText(PDFPage cmds,
java.lang.Object[] ary)
add some text to the page.
|
void |
doText(PDFPage cmds,
java.lang.String text)
add some text to the page.
|
void |
end()
end a span of text
|
void |
flush()
finish any unfinished words.
|
float |
getCharSpacing()
get the char spacing
|
PDFFont |
getFont()
get the font
|
float |
getFontSize()
get the font size
|
float |
getHorizontalScale()
Get the horizontal scale
|
float |
getLeading()
get the leading
|
int |
getMode()
Get the mode of the text
|
float |
getRise()
Get the rise
|
java.awt.geom.AffineTransform |
getTransform()
Get the current transform
|
float |
getWordSpacing()
get the word spacing
|
void |
reset()
reset the PDFTextFormat for a new run
|
void |
setCharSpacing(float spc)
set the character spacing
|
void |
setFont(PDFFont f,
float size)
set the font and size
|
void |
setHorizontalScale(float scl)
set the horizontal scale.
|
void |
setLeading(float spc)
set the leading
|
void |
setMatrix(float[] matrix)
set the transform matrix directly
|
void |
setMode(int m)
set the mode of the text.
|
void |
setRise(float spc)
set the rise
|
void |
setTextFormatMode(int mode)
Set the mode from another text format mode
|
void |
setWordSpacing(float spc)
set the word spacing
|
public PDFTextFormat()
public void reset()
public void end()
public float getCharSpacing()
public void setCharSpacing(float spc)
public float getWordSpacing()
public void setWordSpacing(float spc)
public float getHorizontalScale()
public void setHorizontalScale(float scl)
scl
- the horizontal scale, in percent (100=normal)public float getLeading()
public void setLeading(float spc)
public PDFFont getFont()
public float getFontSize()
public void setFont(PDFFont f, float size)
public int getMode()
public void setMode(int m)
public void setTextFormatMode(int mode)
mode
- the text render mode using the
codes from PDFShapeCmd and not the wacky PDF codespublic float getRise()
public void setRise(float spc)
public void carriageReturn()
public void carriageReturn(float x, float y)
public java.awt.geom.AffineTransform getTransform()
public void setMatrix(float[] matrix)
public void doText(PDFPage cmds, java.lang.String text)
cmds
- the PDFPage to add the commands totext
- the text to addpublic void doText(PDFPage cmds, java.lang.Object[] ary) throws PDFParseException
cmds
- the PDFPage to add the commands toary
- an array of Strings and Doubles, where the Strings
represent text to be added, and the Doubles represent kerning
amounts.PDFParseException
public void flush()
public java.lang.Object clone()
clone
in class java.lang.Object