sempdf
sempdf v1.9.1Interfaces

Interface: TextOptions

sempdf v1.9.1


sempdf / TextOptions

Defined in: src/types.ts:839

Options for placing a single line of text.

Extends

  • ArtifactOptions

Properties

PropertyTypeDescriptionInherited fromDefined in
artifactSubtype?"Header" | "Footer" | "Watermark"Optional artifact subtype, such as Header, Footer, or Watermark.ArtifactOptions.artifactSubtypesrc/types.ts:379
artifactType?"Pagination" | "Layout" | "Page"Artifact type written to the marked-content property dictionary.ArtifactOptions.artifactTypesrc/types.ts:377
bold?booleanSelects 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?numberAdditional spacing between characters in PDF points.-src/types.ts:872
color?ColorInputColor used for drawing, text, or highlighting.-src/types.ts:870
direction?TextDirectionText 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?PdfFontFont used to render text.-src/types.ts:845
fontSize?numberFont size in PDF points.-src/types.ts:868
highlight?ColorInputBackground color drawn as a filled rectangle behind the text (inline highlight).-src/types.ts:916
horizontalScaling?numberHorizontal glyph scaling as a percentage (100 = normal; the Tz operator).-src/types.ts:914
italic?booleanSelects the italic/oblique variant of font, following the same resolution rules as bold. Combine with bold for bold italic.-src/types.ts:858
kerning?booleanWhether kerning should be applied where supported.-src/types.ts:878
leading?numberText leading value in PDF points.-src/types.ts:876
renderMode?TextRenderModeGlyph painting mode (fill, stroke/outline, fillStroke, invisible). Defaults to fill.-src/types.ts:908
rise?numberRaises (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?booleanDraws a strike-through line over the text.-src/types.ts:862
strokeColor?ColorInputStroke color for stroke/fillStroke render modes. Defaults to the text color.-src/types.ts:910
strokeWidth?numberStroke width in PDF points for stroke/fillStroke render modes. Defaults to 1.-src/types.ts:912
structure?PdfStructureOptionsAdditional structure metadata for tagged PDF output.-src/types.ts:887
subscript?booleanRenders the text as subscript — lowered below the baseline and reduced in size.-src/types.ts:906
superscript?booleanRenders the text as superscript — raised above the baseline and reduced in size. Convenience over rise + a smaller fontSize.-src/types.ts:904
tag?TextTagOrArtifactStructure tag used for tagged PDF output.-src/types.ts:885
underline?booleanDraws an underline beneath the text.-src/types.ts:860
wordSpacing?numberAdditional spacing between words in PDF points.-src/types.ts:874
writingMode?WritingModeText writing mode. "horizontal" (default) places characters left-to-right. "vertical" stacks characters top-to-bottom.-src/types.ts:883
xnumberHorizontal position in PDF points.-src/types.ts:841
ynumberVertical position in PDF points.-src/types.ts:843

On this page