Click or drag to resize

PdfTextFormat Class

Represents formatting properties that only affect PDF textual content.
Inheritance Hierarchy
SystemObject
  SautinSoft.Pdf.ContentPdfTextFormat

Namespace: SautinSoft.Pdf.Content
Assembly: SautinSoft.Pdf (in SautinSoft.Pdf.dll) Version: 2026.5.19
Syntax
public sealed class PdfTextFormat

The PdfTextFormat type exposes the following members.

Properties
 NameDescription
Public propertyCharacterSpacing

Gets or sets the character spacing in unscaled text space units (although it shall be subject to scaling by the HorizontalScaling parameter if the writing mode is horizontal).

When the glyph for each character in the string is rendered, CharacterSpacing shall be added to the horizontal or vertical component of the glyph's displacement, depending on the writing mode.

Initial value: 0.

Public propertyFont

Gets the font.

Initial value: .

Public propertyHorizontalScaling

Gets or sets the horizontal scaling that adjusts the width of glyphs by stretching or compressing them in the horizontal direction.

Its value shall be specified as a percentage of the normal width of the glyphs, with 1.0 (100%) being the normal width. The HorizontalScaling shall apply to the horizontal coordinate in text space, independently of the writing mode. It shall affect both the glyph's shape and its horizontal displacement (that is, its displacement vector). If the writing mode is horizontal, it shall also effect the spacing parameters CharacterSpacing and WordSpacing.

Initial value: 1.0 (100%) (normal width).

Public propertyIsClipped

Gets or sets a value indicating whether the current PDF textual content is part of the clipping area (the same as IsApplied property on PdfTextContent).

Initial value: .

Public propertyIsFilled

Gets or sets a value indicating whether the current PDF textual content is filled (the same as IsApplied property on PdfTextContent).

Initial value: .

Public propertyIsStroked

Gets or sets a value indicating whether the current PDF textual content is stroked (the same as IsApplied property on PdfTextContent).

Initial value: .

Public propertyKnockout

Gets or sets the text knockout parameter (PDF 1.4) that determines what PdfTextContent elements shall be considered elementary objects for purposes of colour compositing in the transparent imaging model.

Initial value: .

Public propertyLeading

Gets or sets the leading that specifies the vertical distance between the baselines of adjacent lines of text in unscaled text space units.

Initial value: 0.

Public propertyRise

Gets or sets the rise that shall specify the distance, in unscaled text space units, to move the baseline up or down from its default location. Positive values of Rise shall move the baseline up.

Initial value: 0.

Public propertyWordSpacing

Gets or sets the word spacing that works the same way as CharacterSpacing but shall apply only to the ASCII SPACE character (20h).

Initial value: 0.

Top
Methods
 NameDescription
Public methodGetFont Gets the font and size.
Public methodSetFont

Sets the font and size.

Caution note  Caution
Note that the font might not contain all the necessary information to correctly position, render and/or convert to Unicode all characters of the EncodedText so set it at your own risk.
Top
Remarks

The PdfTextFormat is applicable to PdfTextContent and PdfFormContent, and is not applicable to any other PdfVisualContentElement.

If the PdfTextFormat is not applicable, then text-related graphics state parameters won't be written when writing the associated PdfVisualContentElement to the underlying content stream.

See Also