Table of Contents

Method Convert

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

Convert(byte[], bool)

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

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

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.

Returns

Attachment

A new Attachment containing the generated PDF with embedded email attachments.

Examples

using LMKit.Data;
using LMKit.Document.Conversion;

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

Exceptions

ArgumentNullException

Thrown when emlData is null.

Convert(string, bool)

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

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

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.

Returns

Attachment

A new Attachment containing the generated PDF with embedded email attachments.

Examples

using LMKit.Data;
using LMKit.Document.Conversion;

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

Exceptions

ArgumentException

Thrown when inputPath is null or whitespace.

FileNotFoundException

Thrown when the specified file does not exist.