AddObject(CosObject) Method

Definition

Namespace Broadside
Assembly Broadside.dll

Makes value a new indirect object of the document and returns the reference to it: the next object number the file does not use and no reference in it names, generation 0.

public CosReference AddObject(CosObject value)

Parameters

value
CosObject

The object; a stream must be indirect, so this is how a new stream joins the document.

Returns

CosReference
The reference, which Resolve(CosObject?) resolves to value at once.

Remarks

ISO 32000-2 §7.3.10 and §7.5.4. Place the reference in the document (a dictionary entry, an array element) for the object to be reached. A reference to an object the file does not hold is a reference to null, and stays one: the new object never takes its number. The first call reads every object of the file once to find such references. The next save writes the object whether or not anything refers to it, unless it drops unreachable objects (RemoveUnreachableObjects). A mutation: no read may run concurrently with it.