InsertFromSource

Content stream editing

Description

Parses a content snippet of one or more instructions and inserts the resulting instructions into the list at a zero-based position

Syntax

Delphi

Function TPDFContentProgram.InsertFromSource(Index: Integer; Const Source: AnsiString): Integer;

Parameters

IndexZero-based insertion position; passing the current Count appends at the end of the list
SourceThe content snippet to parse, containing one or more instructions

Return values

The number of instructions inserted, 0 when the snippet does not parse

Remarks

Instructions already at Index and beyond shift toward the end to make room

A snippet that does not parse inserts nothing, which the returned 0 reflects

See also

Parse, Count, Delete, Emit, TPDFContentProgram