Click or drag to resize
Pdftools logo

TextGenerator Class

Inheritance Hierarchy
SystemObject
  PdfTools.Toolbox.InternalNativeBase
    PdfTools.Toolbox.InternalNativeObject
      PdfTools.Toolbox.Pdf.ContentTextGenerator

Namespace: PdfTools.Toolbox.Pdf.Content
Assembly: PdfTools.Toolbox (in PdfTools.Toolbox.dll) Version: 1.4.0+02318d3e3f9645a1305b87026fb971a660079e54
Syntax
C#
public class TextGenerator : NativeObject, 
	IDisposable

The TextGenerator type exposes the following members.

Constructors
 NameDescription
Public methodTextGenerator

Create a new text generator for appending text to a text content object.

All parameters that cannot be set in the constructor are set to default values:
  • Rendering: fill text with black paint
  • CharacterSpacing: 0
  • WordSpacing: 0
  • HorizontalScaling: 1
  • Leading: 1.2 times the fontSize (The font's Leading is not used.)
  • Rise: 0
  • Stroke:
  • IntersectClipping:
Top
Properties
 NameDescription
Public propertyCharacterSpacing

The current character spacing.

When the glyph for each character in the string is rendered, the character spacing is added to the horizontal or vertical component of the glyph’s displacement, depending on the writing mode. It is subject to scaling by the horizontal scaling if the writing mode is horizontal.

Default value: 0

Public propertyFill

The paint for filling

The fill paint or if the text should not be filled.
Public propertyFont

The current font.

The font is used for all subsequent Show(String) and ShowLine(String) calls.
Public propertyFontSize

The current font size.

The font size is used for all subsequent Show(String) and ShowLine(String) calls.

Note that this sets the font size only. Also use Leading to set the leading.

Public propertyHorizontalScaling

The current horizontal scaling.

The horizontal scaling parameter adjusts the width of glyphs by stretching or compressing them in the horizontal direction. Its value is specified relative to the normal width of the glyphs, with 1 being the normal width.

Default value: 1

Public propertyLeading

The current leading.

The leading parameter specifies the vertical distance between the baselines of adjacent lines of text. It affects only the method ShowLine(String).

Default value: 1.2 times the initial font size.

See also Leading.

Public propertyRise

The current rise of the baseline.

Text rise specifies the distance to move the baseline up or down from its default location. Positive values of text rise move the baseline up. Adjustments to the baseline are useful for drawing superscripts or subscripts.

Default: 0

Public propertyStroke

The stroke properties

The stroke properties or if the text should not be stroked.
Public propertyWordSpacing

The current word spacing.

Word spacing works the same way as character spacing, but applies only to the space character, code 32.

Default value: 0

Top
Methods
 NameDescription
Public methodDispose

Close the object

Release all native resources associated with the object.
Public methodEquals
(Inherited from NativeObject)
Public methodGetHashCode
(Inherited from NativeObject)
Public methodGetWidth

Get the width of a text string.

The width of a text string as if it would be shown with the current settings.
Public methodMoveTo

Move the current position.

This also also sets the beginning of the current line to the specified position, which will affect the ShowLine(String) method.
Public methodShow

Show a text string.

The text is shown using the current settings.
Public methodShowLine

Show a text string and go to the next line.

Top
See Also