PDFsharp-net6

PdfResources

Namespace: PdfSharp.Pdf.Advanced

Represents a PDF resource object.

public sealed class PdfResources : PdfSharp.Pdf.PdfDictionary, System.ICloneable, System.Collections.Generic.IEnumerable`1[[System.Collections.Generic.KeyValuePair`2[[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[PdfSharp.Pdf.PdfItem, PdfSharp, Version=0.1.3.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Collections.IEnumerable

Inheritance ObjectPdfItemPdfObjectPdfDictionaryPdfResources
Implements ICloneable, IEnumerable<KeyValuePair<String, PdfItem>>, IEnumerable

Properties

Elements

Gets the dictionary containing the elements of this dictionary.

public DictionaryElements Elements { get; }

Property Value

DictionaryElements

Stream

Gets or sets the PDF stream belonging to this dictionary. Returns null if the dictionary has no stream. To create the stream, call the CreateStream function.

public PdfStream Stream { get; set; }

Property Value

PdfStream

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

PdfResources(PdfDocument)

Initializes a new instance of the PdfResources class.

public PdfResources(PdfDocument document)

Parameters

document PdfDocument
The document.

Methods

AddFont(PdfFont)

Adds the specified font to this resource dictionary and returns its local resource name.

public string AddFont(PdfFont font)

Parameters

font PdfFont

Returns

String

AddImage(PdfImage)

Adds the specified image to this resource dictionary and returns its local resource name.

public string AddImage(PdfImage image)

Parameters

image PdfImage

Returns

String

AddForm(PdfFormXObject)

Adds the specified form object to this resource dictionary and returns its local resource name.

public string AddForm(PdfFormXObject form)

Parameters

form PdfFormXObject

Returns

String

AddExtGState(PdfExtGState)

Adds the specified graphics state to this resource dictionary and returns its local resource name.

public string AddExtGState(PdfExtGState extGState)

Parameters

extGState PdfExtGState

Returns

String

AddPattern(PdfShadingPattern)

Adds the specified pattern to this resource dictionary and returns its local resource name.

public string AddPattern(PdfShadingPattern pattern)

Parameters

pattern PdfShadingPattern

Returns

String

AddPattern(PdfTilingPattern)

Adds the specified pattern to this resource dictionary and returns its local resource name.

public string AddPattern(PdfTilingPattern pattern)

Parameters

pattern PdfTilingPattern

Returns

String

AddShading(PdfShading)

Adds the specified shading to this resource dictionary and returns its local resource name.

public string AddShading(PdfShading shading)

Parameters

shading PdfShading

Returns

String

ExistsResourceName(String)

Check whether a resource name is already used in the context of this resource dictionary. PDF4NET uses GUIDs as resource names, but I think this weapon is to heavy.

internal bool ExistsResourceName(string name)

Parameters

name String

Returns

Boolean