THPDFHeadlessDocument.AppendPageText

procedure AppendPageText(PageIndex: Integer; const Text: UnicodeString;
  const TrueTypeFont: SysUtils.TBytes; const Rectangle: THPDFRectangle;
  const Options: THPDFHeadlessTextAppearanceOptions; Invisible: Boolean = False;
  FitToRectangle: Boolean = False);

Append a genuine embedded Unicode Form XObject to an existing zero-based page without replacing original content; direct and indirect content arrays are normalized to stream references

Rectangle coordinates use PDF user space, and the appearance options control font, color, spacing, alignment, shaping and quarter-turn rotation

Invisible true inserts text rendering mode 3; FitToRectangle true fits single-line text using actual vertical font metrics and horizontal text scaling, which is useful for OCR word geometry

Resources are cloned before mutation, generated objects are preflighted against document limits, cancellation and preflight failure preserve the original page, and encrypted saves use the original AES security policy

User-password page editing requires content modification permission; signed or certified documents require an editing policy outside this method and are rejected

Verified with native Linux FPC 3.2.2/3.3.1, Windows FPC and Delphi Win32/Win64, C++Builder headers, strict independent extraction and pixel-identical invisible search layers

Document API · Native workflows