Insert(Int32, CosReference) Method

Definition

Namespace Broadside
Assembly Broadside.dll

Inserts an existing page object of the document, not yet in the page tree, at index.

public PdfPage Insert(int index, CosReference pageObject)

Parameters

index
Int32

The page's index: 0 to insert before the first page, Count to add after the last.

pageObject
CosReference

The page object's reference: a dictionary added with AddObject(CosObject), for instance a page copied from another document. Its Type shall be Page (it is set when absent).

Returns

PdfPage
The page.

Remarks

ISO 32000-2 §7.7.3.2 and §7.7.3.3 (PDF 1.0). A page appears in the page tree once, so a page of the document is moved with Move(Int32, Int32), not inserted again. The page's Parent is set; the attributes it does not have are not inherited from anywhere, so give it its own MediaBox and Resources.