com.lowagie.text.pdf
Class VerticalText

java.lang.Object
  extended bycom.lowagie.text.pdf.VerticalText

public class VerticalText
extends Object

Writes text vertically. Note that the naming is done according to horizontal text although it refers to vertical text. A line with the alignment Element.LEFT_ALIGN will actually be top aligned.


Field Summary
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.
 
Constructor Summary
VerticalText(PdfContentByte text)
          Creates new VerticalText
 
Method Summary
 void addText(Chunk chunk)
          Adds a Chunk to the current text array.
 void addText(Phrase phrase)
          Adds a Phrase to the current text 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_MORE_TEXT

public static final int NO_MORE_TEXT
Signals that there are no more text available.

See Also:
Constant Field Values

NO_MORE_COLUMN

public static final int NO_MORE_COLUMN
Signals that there is no more column.

See Also:
Constant Field Values
Constructor Detail

VerticalText

public VerticalText(PdfContentByte text)
Creates new VerticalText

Parameters:
text - the place where the text will be written to. Can be a template.
Method Detail

addText

public void addText(Phrase phrase)
Adds a Phrase to the current text array.

Parameters:
phrase - the text

addText

public void addText(Chunk chunk)
Adds a Chunk to the current text array.

Parameters:
chunk - the text

setVerticalLayout

public void setVerticalLayout(float startX,
                              float startY,
                              float height,
                              int maxLines,
                              float leading)
Sets the layout.

Parameters:
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

setLeading

public void setLeading(float leading)
Sets the separation between the vertical lines.

Parameters:
leading - the vertical line separation

getLeading

public float getLeading()
Gets the separation between the vertical lines.

Returns:
the vertical line separation

go

public int go()
Outputs the lines to the document. It is equivalent to go(false).

Returns:
returns the result of the operation. It can be NO_MORE_TEXT and/or NO_MORE_COLUMN

go

public int go(boolean simulate)
Outputs the lines to the document. The output can be simulated.

Parameters:
simulate - true to simulate the writing to the document
Returns:
returns the result of the operation. It can be NO_MORE_TEXT and/or NO_MORE_COLUMN

setOrigin

public void setOrigin(float startX,
                      float startY)
Sets the new text origin.

Parameters:
startX - the X coordinate
startY - the Y coordinate

getOriginX

public float getOriginX()
Gets the X coordinate where the next line will be written. This value will change after each call to go().

Returns:
the X coordinate

getOriginY

public float getOriginY()
Gets the Y coordinate where the next line will be written.

Returns:
the Y coordinate

getMaxLines

public int getMaxLines()
Gets the maximum number of available lines. This value will change after each call to go().

Returns:
Value of property maxLines.

setMaxLines

public void setMaxLines(int maxLines)
Sets the maximum number of lines.

Parameters:
maxLines - the maximum number of lines

getHeight

public float getHeight()
Gets the height of the line

Returns:
the height

setHeight

public void setHeight(float height)
Sets the height of the line

Parameters:
height - the new height

setAlignment

public void setAlignment(int alignment)
Sets the alignment.

Parameters:
alignment - the alignment

getAlignment

public int getAlignment()
Gets the alignment.

Returns:
the alignment


Copyright © 2011 EGIZ - E-Government Innovation Center. All Rights Reserved.