sempdf v1.9.1Interfaces
Interface: TextOptions
sempdf / TextOptions
Defined in: src/types.ts:839
Options for placing a single line of text.
Extends
ArtifactOptions
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
artifactSubtype? | "Header" | "Footer" | "Watermark" | Optional artifact subtype, such as Header, Footer, or Watermark. | ArtifactOptions.artifactSubtype | src/types.ts:379 |
artifactType? | "Pagination" | "Layout" | "Page" | Artifact type written to the marked-content property dictionary. | ArtifactOptions.artifactType | src/types.ts:377 |
bold? | boolean | Selects the bold variant of font. For a built-in family (Helvetica, Times-Roman, Courier) this resolves to the matching bold base font. For a font family registered with PdfDocument.registerFontFamily it selects the registered bold face. Ignored when font is an explicit embedded-font handle. | - | src/types.ts:853 |
characterSpacing? | number | Additional spacing between characters in PDF points. | - | src/types.ts:872 |
color? | ColorInput | Color used for drawing, text, or highlighting. | - | src/types.ts:870 |
direction? | TextDirection | Text direction used for shaping and layout. | - | src/types.ts:866 |
encoding? | "winansi" | "macroman" | "pdfdoc" | Built-in font encoding. When set, the font dictionary emits an /Encoding entry with the specified encoding (e.g. /WinAnsiEncoding). When undefined, the default encoding is used. | - | src/types.ts:893 |
fallbackFonts? | PdfFont[] | Fallback fonts used when the primary font lacks a glyph. | - | src/types.ts:864 |
font? | PdfFont | Font used to render text. | - | src/types.ts:845 |
fontSize? | number | Font size in PDF points. | - | src/types.ts:868 |
highlight? | ColorInput | Background color drawn as a filled rectangle behind the text (inline highlight). | - | src/types.ts:916 |
horizontalScaling? | number | Horizontal glyph scaling as a percentage (100 = normal; the Tz operator). | - | src/types.ts:914 |
italic? | boolean | Selects the italic/oblique variant of font, following the same resolution rules as bold. Combine with bold for bold italic. | - | src/types.ts:858 |
kerning? | boolean | Whether kerning should be applied where supported. | - | src/types.ts:878 |
leading? | number | Text leading value in PDF points. | - | src/types.ts:876 |
renderMode? | TextRenderMode | Glyph painting mode (fill, stroke/outline, fillStroke, invisible). Defaults to fill. | - | src/types.ts:908 |
rise? | number | Raises (positive) or lowers (negative) the text baseline, in PDF points (the Ts operator). Set directly for fine control, or use the superscript / subscript shortcuts. | - | src/types.ts:899 |
strike? | boolean | Draws a strike-through line over the text. | - | src/types.ts:862 |
strokeColor? | ColorInput | Stroke color for stroke/fillStroke render modes. Defaults to the text color. | - | src/types.ts:910 |
strokeWidth? | number | Stroke width in PDF points for stroke/fillStroke render modes. Defaults to 1. | - | src/types.ts:912 |
structure? | PdfStructureOptions | Additional structure metadata for tagged PDF output. | - | src/types.ts:887 |
subscript? | boolean | Renders the text as subscript — lowered below the baseline and reduced in size. | - | src/types.ts:906 |
superscript? | boolean | Renders the text as superscript — raised above the baseline and reduced in size. Convenience over rise + a smaller fontSize. | - | src/types.ts:904 |
tag? | TextTagOrArtifact | Structure tag used for tagged PDF output. | - | src/types.ts:885 |
underline? | boolean | Draws an underline beneath the text. | - | src/types.ts:860 |
wordSpacing? | number | Additional spacing between words in PDF points. | - | src/types.ts:874 |
writingMode? | WritingMode | Text writing mode. "horizontal" (default) places characters left-to-right. "vertical" stacks characters top-to-bottom. | - | src/types.ts:883 |
x | number | Horizontal position in PDF points. | - | src/types.ts:841 |
y | number | Vertical position in PDF points. | - | src/types.ts:843 |