# PdfImageDocumentSource

One image source used to create a PDF page.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`12511d2fa560` with working tree changes

**Source**

[PdfDocument.Images.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/12511d2fa560784a40564a2dc62102d2005ed547/OfficeIMO.Pdf/Core/PdfDocument.Images.cs#L10)

**Modifiers**

sealed

One image source used to create a PDF page.

## Inheritance

- object
- PdfImageDocumentSource

## Usage

Explore 5 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Method [PdfImageDocumentSource.FromFile](/api/pdf/officeimo-pdf-pdfimagedocumentsource/#method-fromfile-string)

### Accepted by parameters 4

- Method [PdfImageConverterExtensions.SaveAsPdf](/api/pdf/officeimo-pdf-pdfimageconverterextensions/#method-saveaspdf-collections-generic-ienumerable-officeimo-pdf-pdfimagedocumentsource-string-officeimo-pdf-pdfimageimportoptions-threading-cancellationtoken) parameter `images`
- Method [PdfImageConverterExtensions.SaveAsPdfAsync](/api/pdf/officeimo-pdf-pdfimageconverterextensions/#method-saveaspdfasync-collections-generic-ienumerable-officeimo-pdf-pdfimagedocumentsource-string-officeimo-pdf-pdfimageimportoptions-threading-cancellationtoken) parameter `images`
- Method [PdfImageConverterExtensions.ToPdf](/api/pdf/officeimo-pdf-pdfimageconverterextensions/#method-topdf-collections-generic-ienumerable-officeimo-pdf-pdfimagedocumentsource-officeimo-pdf-pdfimageimportoptions-threading-cancellationtoken) parameter `images`
- Method [PdfImageConverterExtensions.ToPdfAsync](/api/pdf/officeimo-pdf-pdfimageconverterextensions/#method-topdfasync-collections-generic-ienumerable-officeimo-pdf-pdfimagedocumentsource-officeimo-pdf-pdfimageimportoptions-threading-cancellationtoken) parameter `images`

Filter members 

Show inherited

## Constructors

`public PdfImageDocumentSource(byte[] bytes, string? name = null)` [#](#constructor-ctor-byte-string)

[PdfDocument.Images.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/12511d2fa560784a40564a2dc62102d2005ed547/OfficeIMO.Pdf/Core/PdfDocument.Images.cs#L10)

Creates an image source from an encoded image payload.

Parameters

**bytes byte[] required**

**name string? = null optional**

## Methods

FromFile 2 overloads

`public static PdfImageDocumentSource FromFile(string path)` [#](#method-fromfile-string)

[PdfDocument.Images.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/12511d2fa560784a40564a2dc62102d2005ed547/OfficeIMO.Pdf/Core/PdfDocument.Images.cs#L41)

Creates an image source from a file snapshot.

Parameters

**path string required**

Returns

`PdfImageDocumentSource`

`public static PdfImageDocumentSource FromFile(string path, long maximumEncodedImageBytes)` [#](#method-fromfile-string-int64)

[PdfDocument.Images.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/12511d2fa560784a40564a2dc62102d2005ed547/OfficeIMO.Pdf/Core/PdfDocument.Images.cs#L45)

Creates an image source from a file snapshot within an encoded-byte limit. Document creation applies its own limit.

Parameters

**path string required**

**maximumEncodedImageBytes long required**

Returns

`PdfImageDocumentSource`

`public byte[] GetBytes()` [#](#method-getbytes)

[PdfDocument.Images.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/12511d2fa560784a40564a2dc62102d2005ed547/OfficeIMO.Pdf/Core/PdfDocument.Images.cs#L26)

Returns a caller-owned copy of the encoded image payload.

Returns

`byte[]`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string? Name { get; }` [#](#property-name)

[PdfDocument.Images.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/12511d2fa560784a40564a2dc62102d2005ed547/OfficeIMO.Pdf/Core/PdfDocument.Images.cs#L23)

Optional source name used as PDF alternate text.

<!-- PowerForge markdown artifact sha256:430AD01E960BB6A8050D31F5B1A71DC91F2F51F0F7AA982A917C1F5611629FBB -->
