public class VerticalText extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
alignment
The column alignment.
|
protected ArrayList<PdfChunk> |
chunks
The chunks that form the text.
|
protected int |
currentChunkMarker
Marks the chunks to be eliminated when the line is written.
|
protected PdfChunk |
currentStandbyChunk
The chunk created by the splitting.
|
protected float |
height
The height of the text.
|
protected float |
leading
The leading
|
protected int |
maxLines
The maximum number of vertical lines.
|
static int |
NO_MORE_COLUMN
Signals that there is no more column.
|
static int |
NO_MORE_TEXT
Signals that there are no more text available.
|
protected String |
splittedChunkText
The chunk created by the splitting.
|
protected float |
startX
The X coordinate.
|
protected float |
startY
The Y coordinate.
|
protected PdfContentByte |
text
The PdfContent where the text will be written to.
|
Constructor and Description |
---|
VerticalText(PdfContentByte text)
Creates new VerticalText
|
Modifier and Type | Method and Description |
---|---|
void |
addText(Chunk chunk)
Adds a Chunk to the current text array.
|
void |
addText(Phrase phrase)
Adds a Phrase to the current text array.
|
protected PdfLine |
createLine(float width)
Creates a line from the chunk array.
|
int |
getAlignment()
Gets the alignment.
|
float |
getHeight()
Gets the height of the line
|
float |
getLeading()
Gets the separation between the vertical lines.
|
int |
getMaxLines()
Gets the maximum number of available lines.
|
float |
getOriginX()
Gets the X coordinate where the next line will be written.
|
float |
getOriginY()
Gets the Y coordinate where the next line will be written.
|
int |
go()
Outputs the lines to the document.
|
int |
go(boolean simulate)
Outputs the lines to the document.
|
void |
setAlignment(int alignment)
Sets the alignment.
|
void |
setHeight(float height)
Sets the height of the line
|
void |
setLeading(float leading)
Sets the separation between the vertical lines.
|
void |
setMaxLines(int maxLines)
Sets the maximum number of lines.
|
void |
setOrigin(float startX, float startY)
Sets the new text origin.
|
void |
setVerticalLayout(float startX, float startY, float height, int maxLines, float leading)
Sets the layout.
|
protected void |
shortenChunkArray()
Normalizes the list of chunks when the line is accepted.
|
public static final int NO_MORE_TEXT
public static final int NO_MORE_COLUMN
protected PdfContentByte text
PdfContent
where the text will be written to.
protected int alignment
protected int currentChunkMarker
protected PdfChunk currentStandbyChunk
protected String splittedChunkText
protected float leading
protected float startX
protected float startY
protected int maxLines
protected float height
public VerticalText(PdfContentByte text)
text
- the place where the text will be written to. Can be a template.
public void addText(Phrase phrase)
Phrase
to the current text array.
phrase
- the text
public void addText(Chunk chunk)
Chunk
to the current text array.
chunk
- the text
public void setVerticalLayout(float startX, float startY, float height, int maxLines, float leading)
startX
- the top right X line position
startY
- the top right Y line position
height
- the height of the lines
maxLines
- the maximum number of lines
leading
- the separation between the lines
public void setLeading(float leading)
leading
- the vertical line separation
public float getLeading()
protected PdfLine createLine(float width)
width
- the width of the line
protected void shortenChunkArray()
public int go()
go(false)
.
NO_MORE_TEXT
and/or NO_MORE_COLUMN
public int go(boolean simulate)
simulate
- true
to simulate the writing to the document
NO_MORE_TEXT
and/or NO_MORE_COLUMN
public void setOrigin(float startX, float startY)
startX
- the X coordinate
startY
- the Y coordinate
public float getOriginX()
go()
.
public float getOriginY()
public int getMaxLines()
go()
.
public void setMaxLines(int maxLines)
maxLines
- the maximum number of lines
public float getHeight()
public void setHeight(float height)
height
- the new height
public void setAlignment(int alignment)
alignment
- the alignment
public int getAlignment()
Copyright © 1998–2016. All rights reserved.