ReplaceTextStringRange

Content stream editing

Description

Replaces a byte range inside one string operand, or one TJ array element, of a text-showing instruction

Syntax

Delphi

Function TPDFContentProgram.ReplaceTextStringRange(InstructionIndex, OperandIndex, ArrayElementIndex, ByteOffset, ByteLength: Integer; Const NewText: AnsiString): Boolean;

Parameters

InstructionIndexIndex of the text-showing instruction to edit
OperandIndexIndex of the string operand within that instruction
ArrayElementIndexIndex of the element within a TJ array operand
ByteOffsetOffset in bytes of the range to replace inside the target string
ByteLengthLength in bytes of the range to replace
NewTextReplacement text written over the selected byte range

Return values

True on success, otherwise false

Remarks

Where ReplaceTextRun rewrites the entire shown text of an instruction, this method replaces only the selected byte range and leaves the rest of the operand intact

See also

TPDFContentProgram, ReplaceTextRun, GetTextRuns