Table of Contents

Class PdfChunk

Namespace
iTextSharp.text.pdf
Assembly
iTextSharp.LGPLv2.Core.dll

A PdfChunk is the PDF translation of a Chunk . A PdfChunk is a PdfString in a certain PdfFont and Color . @see PdfString @see PdfFont @see iTextSharp.text.Chunk @see iTextSharp.text.Font

public class PdfChunk
Inheritance
PdfChunk
Inherited Members

Constructors

PdfChunk(string, PdfChunk)

membervariables

public PdfChunk(string str, PdfChunk other)

Parameters

str string
other PdfChunk

PdfChunk(Chunk, PdfAction)

Constructs a PdfChunk -object.

public PdfChunk(Chunk chunk, PdfAction action)

Parameters

chunk Chunk

the original Chunk -object

action PdfAction

the PdfAction if the Chunk comes from an Anchor

Fields

Attributes

Metric attributes. This attributes require the mesurement of characters widths when rendering such as underline.

protected INullValueDictionary<string, object> Attributes

Field Value

INullValueDictionary<string, object>

BaseFont

protected BaseFont BaseFont

Field Value

BaseFont

NewlineSplit

true if the chunk split was cause by a newline.

protected bool NewlineSplit

Field Value

bool

NoStroke

Non metric attributes. This attributes do not require the mesurement of characters widths when rendering such as Color.

protected INullValueDictionary<string, object> NoStroke

Field Value

INullValueDictionary<string, object>

OffsetX

The offset in the x direction for the image

protected float OffsetX

Field Value

float

OffsetY

The offset in the y direction for the image

protected float OffsetY

Field Value

float

SplitCharacter

protected ISplitCharacter SplitCharacter

Field Value

ISplitCharacter

changeLeading

Indicates if the height and offset of the Image has to be taken into account

protected bool changeLeading

Field Value

bool

encoding

The encoding.

protected string encoding

Field Value

string

font

The font for this PdfChunk .

protected PdfFont font

Field Value

PdfFont

image

The image in this PdfChunk , if it has one

protected Image image

Field Value

Image

value

The value of this object.

protected string value

Field Value

string

Properties

ChangeLeading

methods

public bool ChangeLeading { get; }

Property Value

bool

Color

public BaseColor Color { get; }

Property Value

BaseColor

Encoding

public string Encoding { get; }

Property Value

string

Font

public PdfFont Font { get; }

Property Value

PdfFont

Image

public Image Image { get; }

Property Value

Image

ImageOffsetX

public float ImageOffsetX { get; set; }

Property Value

float

ImageOffsetY

public float ImageOffsetY { get; set; }

Property Value

float

Length

Gets the encoding of this string.

public int Length { get; }

Property Value

int

a string

LengthUtf32

public int LengthUtf32 { get; }

Property Value

int

TextRise

Gets the text displacement relatiev to the baseline.

public float TextRise { get; }

Property Value

float

a displacement in points

Value

public string Value { set; }

Property Value

string

Width

public float Width { get; }

Property Value

float

Methods

AdjustLeft(float)

Correction for the tab position based on the left starting position. @since 2.1.2

public void AdjustLeft(float newValue)

Parameters

newValue float

the new value for the left X.

GetAttribute(string)

public object GetAttribute(string name)

Parameters

name string

Returns

object

GetCharWidth(int)

public float GetCharWidth(int c)

Parameters

c int

Returns

float

GetUnicodeEquivalent(int)

Gets the Unicode equivalent to a CID. The (inexistent) CID FF00 is translated as '\n'. It has only meaning with CJK fonts with Identity encoding.

public int GetUnicodeEquivalent(int c)

Parameters

c int

the CID code

Returns

int

the Unicode equivalent

GetWidthCorrected(float, float)

public float GetWidthCorrected(float charSpacing, float wordSpacing)

Parameters

charSpacing float
wordSpacing float

Returns

float

GetWord(string, int)

protected static int GetWord(string text, int start)

Parameters

text string
start int

Returns

int

IsAttribute(string)

public bool IsAttribute(string name)

Parameters

name string

Returns

bool

IsExtSplitCharacter(int, int, int, char[], PdfChunk[])

public bool IsExtSplitCharacter(int start, int current, int end, char[] cc, PdfChunk[] ck)

Parameters

start int
current int
end int
cc char[]
ck PdfChunk[]

Returns

bool

IsHorizontalSeparator()

Checks if this PdfChunk is a horizontal Separator Chunk. @since 2.1.2

public bool IsHorizontalSeparator()

Returns

bool

true if this chunk is a horizontal separator.

IsImage()

public bool IsImage()

Returns

bool

IsNewlineSplit()

public bool IsNewlineSplit()

Returns

bool

IsSeparator()

Checks if this PdfChunk is a Separator Chunk. @since 2.1.2

public bool IsSeparator()

Returns

bool

true if this chunk is a separator.

IsSpecialEncoding()

public bool IsSpecialEncoding()

Returns

bool

IsStroked()

public bool IsStroked()

Returns

bool

IsTab()

Checks if this PdfChunk is a tab Chunk. @since 2.1.2

public bool IsTab()

Returns

bool

true if this chunk is a separator.

NoPrint(int)

public static bool NoPrint(int c)

Parameters

c int

Returns

bool

Split(float)

public PdfChunk Split(float width)

Parameters

width float

Returns

PdfChunk

ToString()

Gets the image in the PdfChunk .

public override string ToString()

Returns

string

the image or null

Trim(string)

public string Trim(string str)

Parameters

str string

Returns

string

TrimFirstSpace()

public float TrimFirstSpace()

Returns

float

TrimLastSpace()

public float TrimLastSpace()

Returns

float

Truncate(float)

public PdfChunk Truncate(float width)

Parameters

width float

Returns

PdfChunk