OperatorCollection
Overview
OperatorCollection is a class in Aspose.PDF FOSS for .NET.
Inherits from: IEnumerable<Operator>, IDisposable.
Collection of content stream operators for a page.
This class provides 22 methods for working with OperatorCollection objects in .NET programs.
Available methods include: Accept, Add, CancelUpdate, Clear, Contains, CopyTo, Delete, Dispose, GetEnumerator, Insert, Remove, Replace, and 3 additional methods.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: Commands, Count, IsFastTextExtractionMode, IsReadOnly.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Commands | OperatorCollection | Read | Alias that returns this collection itself (callers do page.Contents.Commands[i]). |
IsFastTextExtractionMode | bool | Read | Whether the absorber/parser is in fast-text-extraction mode (no glyph-width metrics, character-position approximations only). |
IsReadOnly | bool | Read | Always false: callers may add and remove operators. |
Count | int | Read | Number of operators in the page content stream. |
Methods
| Signature | Description |
|---|---|
Add(op: Operator) | Add an operator to the collection. |
Add(ops: Operator[]) | Add several operators in one call. |
Add(ops: System.Collections.Generic.ICollection<Operator>) | Add several operators from any collection in one call. |
Accept(visitor: IOperatorSelector) | Visit every operator with the given selector. |
CancelUpdate() | Cancel a suppressed-update window (started by SuppressUpdate) without flushing pending changes. |
Clear() | Remove every operator from the collection. |
Contains(op: Operator) | True when op is currently in the collection. |
CopyTo(array: Operator[], index: int) | Copy the live operators (the in-memory mutable list, not the parsed cache) into array starting at index. |
Delete(ops: Operator[]) | Remove every occurrence of each operator in ops. |
Delete(list: System.Collections.Generic.IList<Operator>) | Remove every operator in list. |
Dispose() | Releases resources held by the collection. |
Insert(index: int, op: Operator) | Insert one operator at the given 1-based index. |
Insert(at: int, ops: Operator[]) | Insert several operators at at (1-based). |
Insert(at: int, ops: System.Collections.Generic.IList<Operator>) | Insert several operators (any IList) at at (1-based). |
Remove(op: Operator) | Remove the first occurrence of op; returns true when an operator was removed. |
Replace(operators: System.Collections.Generic.IList<Operator>) | Replace operators in place: each operator in operators overwrites the existing operator at its 1-based Index. |
SuppressUpdate() | Suspend automatic content-stream re-serialization while a batch of operator mutations is performed. |
ResumeUpdate() | Resume automatic content-stream re-serialization. |
ResumeUpdate(updateAll: bool) | Resume automatic re-serialization with optional full-flush semantics (the updateAll flag is stored only). |
Delete(index: int) | Remove operator at the given 1-based index. |
GetEnumerator() | Enumerate all operators in the content stream as typed Operator instances (with RawOperator fallback for unrecognised commands). |
ToString() | Returns all operators as a single string. |