PDFsharp-net6

PdfContents

Namespace: PdfSharp.Pdf.Advanced

Represents an array of PDF content streams of a page.

public sealed class PdfContents : PdfSharp.Pdf.PdfArray, System.ICloneable, System.Collections.Generic.IEnumerable`1[[PdfSharp.Pdf.PdfItem, PdfSharp, Version=0.1.3.0, Culture=neutral, PublicKeyToken=null]], System.Collections.IEnumerable

Inheritance ObjectPdfItemPdfObjectPdfArrayPdfContents
Implements ICloneable, IEnumerable<PdfItem>, IEnumerable

Properties

Elements

Gets the collection containing the elements of this object.

public ArrayElements Elements { get; }

Property Value

ArrayElements

Owner

Gets the PdfDocument this object belongs to.

public PdfDocument Owner { get; }

Property Value

PdfDocument

IsIndirect

Indicates whether the object is an indirect object.

public bool IsIndirect { get; }

Property Value

Boolean

Internals

Gets the PdfInternals object of this document, that grants access to some internal structures which are not part of the public interface of PdfDocument.

public PdfObjectInternals Internals { get; }

Property Value

PdfObjectInternals

Reference

Gets the indirect reference of this object. If the value is null, this object is a direct object.

public PdfReference Reference { get; internal set; }

Property Value

PdfReference

ReferenceNotNull

Gets the indirect reference of this object. Throws if it is null.

public PdfReference ReferenceNotNull { get; }

Property Value

PdfReference

Exceptions

InvalidOperationException
The indirect reference must be not null here.

Constructors

PdfContents(PdfDocument)

Initializes a new instance of the PdfContents class.

public PdfContents(PdfDocument document)

Parameters

document PdfDocument
The document.

Methods

AppendContent()

Appends a new content stream and returns it.

public PdfContent AppendContent()

Returns

PdfContent

PrependContent()

Prepends a new content stream and returns it.

public PdfContent PrependContent()

Returns

PdfContent

CreateSingleContent()

Creates a single content stream with the bytes from the array of the content streams. This operation does not modify any of the content streams in this array.

public PdfContent CreateSingleContent()

Returns

PdfContent

ReplaceContent(CSequence)

Replaces the current content of the page with the specified content sequence.

public PdfContent ReplaceContent(CSequence cseq)

Parameters

cseq CSequence

Returns

PdfContent

WriteObject(PdfWriter)

internal void WriteObject(PdfWriter writer)

Parameters

writer PdfWriter

GetEnumerator()

Gets the enumerator.

public IEnumerator<PdfContent> GetEnumerator()

Returns

IEnumerator<PdfContent>