Table of Contents

Method Convert

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

Convert(byte[], bool, CancellationToken)

Converts an EML file (as a byte array) into a PDF attachment.

public static Attachment Convert(byte[] emlData, bool stripQuotes = false, CancellationToken cancellationToken = default)

Parameters

emlData byte[]

The EML file content as a byte array.

stripQuotes bool

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

cancellationToken CancellationToken

Cancels the operation.

Returns

Attachment

Examples

byte[] emlBytes = File.ReadAllBytes("invoice.eml");
Attachment pdf = EmlToPdf.Convert(emlBytes);

Convert(string, bool, CancellationToken)

Converts an EML file at the specified path into a PDF attachment.

public static Attachment Convert(string inputPath, bool stripQuotes = false, CancellationToken cancellationToken = default)

Parameters

inputPath string

The file system path to the EML file.

stripQuotes bool

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

cancellationToken CancellationToken

Cancels the operation.

Returns

Attachment

Examples

Attachment pdf = EmlToPdf.Convert("message.eml");
File.WriteAllBytes("message.pdf", pdf.GetData());
Share