Class VerticalText
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
Writes text vertically. Note that the naming is done according to horizontal text although it referrs to vertical text. A line with the alignment Element.LEFT_ALIGN will actually be top aligned.
public class VerticalText
- Inheritance
-
VerticalText
- Inherited Members
Constructors
VerticalText(PdfContentByte)
Creates new VerticalText be a template.
public VerticalText(PdfContentByte text)
Parameters
text
PdfContentBytethe place where the text will be written to. Can
Fields
Chunks
The chunks that form the text.
protected List<PdfChunk> Chunks
Field Value
CurrentChunkMarker
Marks the chunks to be eliminated when the line is written.
protected int CurrentChunkMarker
Field Value
CurrentStandbyChunk
The chunk created by the splitting.
protected PdfChunk CurrentStandbyChunk
Field Value
NoMoreColumn
Signals that there is no more column.
public static int NoMoreColumn
Field Value
NoMoreText
Signals that there are no more text available.
public static int NoMoreText
Field Value
SplittedChunkText
The chunk created by the splitting.
protected string SplittedChunkText
Field Value
StartX
The X coordinate.
protected float StartX
Field Value
StartY
The Y coordinate.
protected float StartY
Field Value
Text
The PdfContent where the text will be written to.
protected PdfContentByte Text
Field Value
alignment
The column Element. Default is left Element.
protected int alignment
Field Value
height
The height of the text.
protected float height
Field Value
leading
The leading
protected float leading
Field Value
maxLines
The maximum number of vertical lines.
protected int maxLines
Field Value
Properties
Alignment
Gets the Element.
public int Alignment { get; set; }
Property Value
- int
the alignment
Height
Gets the height of the line
public float Height { get; set; }
Property Value
- float
the height
Leading
Gets the separation between the vertical lines.
public float Leading { get; set; }
Property Value
- float
the vertical line separation
MaxLines
Gets the maximum number of available lines. This value will change after each call to go() .
public int MaxLines { get; set; }
Property Value
- int
Value of property maxLines.
OriginX
Gets the X coordinate where the next line will be writen. This value will change after each call to go() .
public float OriginX { get; }
Property Value
- float
the X coordinate
OriginY
Gets the Y coordinate where the next line will be writen.
public float OriginY { get; }
Property Value
- float
the Y coordinate
Methods
AddText(Chunk)
Adds a Chunk to the current text array.
public void AddText(Chunk chunk)
Parameters
chunk
Chunkthe text
AddText(Phrase)
Adds a Phrase to the current text array.
public void AddText(Phrase phrase)
Parameters
phrase
Phrasethe text
CreateLine(float)
Creates a line from the chunk array.
protected PdfLine CreateLine(float width)
Parameters
width
floatthe width of the line
Returns
- PdfLine
the line or null if no more chunks
Go()
Outputs the lines to the document. It is equivalent to go(false) . and/or NO_MORE_COLUMN @throws DocumentException on error
public int Go()
Returns
- int
returns the result of the operation. It can be NO_MORE_TEXT
Go(bool)
Outputs the lines to the document. The output can be simulated. and/or NO_MORE_COLUMN @throws DocumentException on error
public int Go(bool simulate)
Parameters
simulate
booltrue to simulate the writting to the document
Returns
- int
returns the result of the operation. It can be NO_MORE_TEXT
SetOrigin(float, float)
Sets the new text origin.
public void SetOrigin(float startX, float startY)
Parameters
SetVerticalLayout(float, float, float, int, float)
Sets the layout.
public void SetVerticalLayout(float startX, float startY, float height, int maxLines, float leading)
Parameters
startX
floatthe top right X line position
startY
floatthe top right Y line position
height
floatthe height of the lines
maxLines
intthe maximum number of lines
leading
floatthe separation between the lines
ShortenChunkArray()
Normalizes the list of chunks when the line is accepted.
protected void ShortenChunkArray()