Table of Contents

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 PdfContentByte

the place where the text will be written to. Can

Fields

Chunks

The chunks that form the text.

protected List<PdfChunk> Chunks

Field Value

List<PdfChunk>

CurrentChunkMarker

Marks the chunks to be eliminated when the line is written.

protected int CurrentChunkMarker

Field Value

int

CurrentStandbyChunk

The chunk created by the splitting.

protected PdfChunk CurrentStandbyChunk

Field Value

PdfChunk

NoMoreColumn

Signals that there is no more column.

public static int NoMoreColumn

Field Value

int

NoMoreText

Signals that there are no more text available.

public static int NoMoreText

Field Value

int

SplittedChunkText

The chunk created by the splitting.

protected string SplittedChunkText

Field Value

string

StartX

The X coordinate.

protected float StartX

Field Value

float

StartY

The Y coordinate.

protected float StartY

Field Value

float

Text

The PdfContent where the text will be written to.

protected PdfContentByte Text

Field Value

PdfContentByte

alignment

The column Element. Default is left Element.

protected int alignment

Field Value

int

height

The height of the text.

protected float height

Field Value

float

leading

The leading

protected float leading

Field Value

float

maxLines

The maximum number of vertical lines.

protected int maxLines

Field Value

int

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 Chunk

the text

AddText(Phrase)

Adds a Phrase to the current text array.

public void AddText(Phrase phrase)

Parameters

phrase Phrase

the text

CreateLine(float)

Creates a line from the chunk array.

protected PdfLine CreateLine(float width)

Parameters

width float

the 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 bool

true 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

startX float

the X coordinate

startY float

the Y coordinate

SetVerticalLayout(float, float, float, int, float)

Sets the layout.

public void SetVerticalLayout(float startX, float startY, float height, int maxLines, float leading)

Parameters

startX float

the top right X line position

startY float

the top right Y line position

height float

the height of the lines

maxLines int

the maximum number of lines

leading float

the separation between the lines

ShortenChunkArray()

Normalizes the list of chunks when the line is accepted.

protected void ShortenChunkArray()