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
| InstructionIndex | Index of the text-showing instruction to edit |
|---|---|
| OperandIndex | Index of the string operand within that instruction |
| ArrayElementIndex | Index of the element within a TJ array operand |
| ByteOffset | Offset in bytes of the range to replace inside the target string |
| ByteLength | Length in bytes of the range to replace |
| NewText | Replacement 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