• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class MailMergeImageSource

Describes image bytes supplied to a mail merge.

Inheritance
object
MailMergeImageSource
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
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.

Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX