Table of Contents

Class EmlToPdf

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

Provides methods to convert EML (email) files into PDF documents.

public static class EmlToPdf
Inheritance
EmlToPdf
Inherited Members

Examples

Example: Convert an EML file to PDF with embedded attachments

using LMKit.Document.Conversion;

EmlToPdf.ConvertToFile("message.eml", "message.pdf");

Remarks

The EmlToPdf class converts email messages to PDF using the Markdown intermediate representation: the email body, headers, and metadata are first converted to Markdown via EmlToMarkdown, then rendered to PDF via MarkdownToPdf.

Email attachments and inline images are embedded in the output PDF as PDF file attachments, preserving their original file names and data.

Every method takes an optional CancellationToken and exposes a matching async variant. Output is available as an Attachment, a file path, a writable Stream, or a byte array.

Methods

Convert(byte[], bool, CancellationToken)

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

Convert(string, bool, CancellationToken)

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

ConvertAsync(byte[], bool, CancellationToken)

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

ConvertAsync(string, bool, CancellationToken)

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

ConvertToBytes(byte[], bool, CancellationToken)

Converts EML bytes into PDF and returns the result as a byte array.

ConvertToBytes(string, bool, CancellationToken)

Converts an EML file into PDF and returns the result as a byte array.

ConvertToBytesAsync(byte[], bool, CancellationToken)

Converts EML bytes into PDF and returns the result as a byte array.

ConvertToBytesAsync(string, bool, CancellationToken)

Converts an EML file into PDF and returns the result as a byte array.

ConvertToFile(byte[], string, bool, CancellationToken)

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

ConvertToFile(string, string, bool, CancellationToken)

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

ConvertToFileAsync(byte[], string, bool, CancellationToken)

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

ConvertToFileAsync(string, string, bool, CancellationToken)

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

ConvertToStream(byte[], Stream, bool, CancellationToken)

Converts EML bytes into PDF and writes them to a writable stream.

ConvertToStream(string, Stream, bool, CancellationToken)

Converts an EML file into PDF and writes the result to a writable stream.

ConvertToStreamAsync(byte[], Stream, bool, CancellationToken)

Converts EML bytes into PDF and writes them to a writable stream.

ConvertToStreamAsync(string, Stream, bool, CancellationToken)

Converts an EML file into PDF and writes the result to a writable stream.

Share