Class MailMergeImageSource
Describes image bytes supplied to a mail merge.
Inherited Members
Namespace: DRIT.Document
Assembly: DRIT.Document.dll
Syntax
public sealed class MailMergeImageSource
Constructors
MailMergeImageSource(byte[], string, string)
Creates an image source from bytes and optional metadata.
Declaration
public MailMergeImageSource(byte[] bytes, string fileName = null, string contentType = null)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bytes | The complete image payload. |
| string | fileName | An optional file name used for content-type detection. |
| string | contentType | An optional MIME content type. |
Properties
Bytes
Gets the complete image payload.
Declaration
public byte[] Bytes { get; }
Property Value
| Type | Description |
|---|---|
| byte[] |
ContentType
Gets the optional MIME content type.
Declaration
public string ContentType { get; }
Property Value
| Type | Description |
|---|---|
| string |
FileName
Gets the optional source file name.
Declaration
public string FileName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
FromFile(string, string)
Creates an image source by reading a file.
Declaration
public static MailMergeImageSource FromFile(string fileName, string contentType = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | The image file path. |
| string | contentType | An optional MIME content type. |
Returns
| Type | Description |
|---|---|
| MailMergeImageSource | A detached image source. |
FromStream(Stream, string, string)
Creates an image source by copying the remaining stream content.
Declaration
public static MailMergeImageSource FromStream(Stream stream, string fileName = null, string contentType = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream containing the image payload. |
| string | fileName | An optional file name used for content-type detection. |
| string | contentType | An optional MIME content type. |
Returns
| Type | Description |
|---|---|
| MailMergeImageSource | A detached image source. |