Table of Contents

Class Letter

Namespace
UglyToad.PdfPig.Content
Assembly
UglyToad.PdfPig.dll

A glyph or combination of glyphs (characters) drawn by a PDF content stream.

public class Letter
Inheritance
Letter
Inherited Members

Constructors

Letter(string, PdfRectangle, PdfPoint, PdfPoint, double, double, FontDetails, TextRenderingMode, IColor, IColor, double, int)

Create a new letter to represent some text drawn by the Tj operator.

public Letter(string value, PdfRectangle glyphRectangle, PdfPoint startBaseLine, PdfPoint endBaseLine, double width, double fontSize, FontDetails font, TextRenderingMode renderingMode, IColor strokeColor, IColor fillColor, double pointSize, int textSequence)

Parameters

value string
glyphRectangle PdfRectangle
startBaseLine PdfPoint
endBaseLine PdfPoint
width double
fontSize double
font FontDetails
renderingMode TextRenderingMode
strokeColor IColor
fillColor IColor
pointSize double
textSequence int

Properties

Color

The primary color of the letter, which is either the StrokeColor in case RenderingMode is Stroke, or otherwise it is the FillColor.

public IColor Color { get; }

Property Value

IColor

EndBaseLine

The end point of the baseline.

public PdfPoint EndBaseLine { get; }

Property Value

PdfPoint

FillColor

Non-stroking (fill) color

public IColor FillColor { get; }

Property Value

IColor

Font

Details about the font for this letter.

public FontDetails Font { get; }

Property Value

FontDetails

FontName

The name of the font.

public string FontName { get; }

Property Value

string

FontSize

Size as defined in the PDF file. This is not equivalent to font size in points but is relative to other font sizes on the page.

public double FontSize { get; }

Property Value

double

GlyphRectangle

Position of the bounding box for the glyph, this is the box surrounding the visible glyph as it appears on the page. For example letters with descenders, p, j, etc., will have a box extending below the Location they are placed at. The width of the glyph may also be more or less than the Width allocated for the character in the PDF content.

public PdfRectangle GlyphRectangle { get; }

Property Value

PdfRectangle

Location

The placement position of the character in PDF space. See StartBaseLine

public PdfPoint Location { get; }

Property Value

PdfPoint

PointSize

The size of the font in points.

public double PointSize { get; }

Property Value

double

RenderingMode

Text rendering mode that indicates whether we should draw this letter's strokes, fill, both, neither (in case of hidden text), etc. If it calls for stroking the StrokeColor is used. If it calls for filling, the FillColor is used. In modes that perform both filling and stroking, the effect is as if each glyph outline were filled and then stroked in separate operations.

public TextRenderingMode RenderingMode { get; }

Property Value

TextRenderingMode

StartBaseLine

The placement position of the character in PDF space (the start point of the baseline). See Location

public PdfPoint StartBaseLine { get; }

Property Value

PdfPoint

StrokeColor

Stroking color

public IColor StrokeColor { get; }

Property Value

IColor

TextOrientation

Text orientation of the letter.

public TextOrientation TextOrientation { get; }

Property Value

TextOrientation

TextSequence

Sequence number of the ShowText operation that printed this letter.

public int TextSequence { get; }

Property Value

int

Value

The text for this letter or unicode character.

public string Value { get; }

Property Value

string

Width

The width occupied by the character within the PDF content.

public double Width { get; }

Property Value

double

Methods

ToString()

Produces a string representation of the letter and its position.

public override string ToString()

Returns

string