Table of Contents

Method ConvertAsync

Namespace
LMKit.Document.Conversion
Assembly
LM-Kit.NET.dll

ConvertAsync(byte[], bool, CancellationToken)

Asynchronously converts an EML or Outlook MSG file (as a byte array) to Markdown.

public static Task<string> ConvertAsync(byte[] emlData, bool stripQuotes = false, CancellationToken cancellation = default)

Parameters

emlData byte[]

The EML or Outlook MSG file content as a byte array.

stripQuotes bool

When true, quoted and reply content is removed from the email body.

cancellation CancellationToken

A cancellation token used to cancel the conversion operation.

Returns

Task<string>

A task whose result is a Markdown string representing the email content.

Exceptions

ArgumentNullException

Thrown when emlData is null.

ConvertAsync(string, bool, CancellationToken)

Asynchronously converts an EML or Outlook MSG file at the specified path to Markdown.

public static Task<string> ConvertAsync(string inputPath, bool stripQuotes = false, CancellationToken cancellation = default)

Parameters

inputPath string

The file system path to the EML or Outlook MSG file.

stripQuotes bool

When true, quoted and reply content is removed from the email body.

cancellation CancellationToken

A cancellation token used to cancel the conversion operation.

Returns

Task<string>

A task whose result is a Markdown string representing the email content.

Exceptions

ArgumentException

Thrown when inputPath is null or whitespace.

FileNotFoundException

Thrown when the specified file does not exist.

Share