PDFsharp-net6

PdfImage

Namespace: PdfSharp.Pdf.Advanced

Represents an image.

public sealed class PdfImage : PdfXObject, 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 ObjectPdfItemPdfObjectPdfDictionaryPdfXObjectPdfImage
Implements ICloneable, IEnumerable<KeyValuePair<String, PdfItem>>, IEnumerable

Properties

Image

Gets the underlying XImage object.

public XImage Image { get; }

Property Value

XImage

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

PdfImage(PdfDocument, XImage)

Initializes a new instance of PdfImage from an XImage.

public PdfImage(PdfDocument document, XImage image)

Parameters

document PdfDocument

image XImage

Methods

ToString()

Returns ‘Image’.

public string ToString()

Returns

String

DoFaxEncodingGroup4(Byte[]&, Byte[], UInt32, UInt32, UInt32)

Encodes a bitonal bitmap using 2D group 4 CCITT fax encoding.

internal static int DoFaxEncodingGroup4(Byte[]& imageData, Byte[] imageBits, uint bytesFileOffset, uint width, uint height)

Parameters

imageData Byte[]&
Space reserved for the fax encoded bitmap. An exception will be thrown if this buffer is too small.

imageBits Byte[]
The bitmap to be encoded.

bytesFileOffset UInt32
Offset of image data in bitmap file.

width UInt32
The width of the image.

height UInt32
The height of the image.

Returns

Int32
The size of the fax encoded image (0 on failure).