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
emlDatabyte[]The EML file content as a byte array.
stripQuotesboolWhen
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
emlDataisnull.
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
inputPathstringThe file system path to the EML file.
stripQuotesboolWhen
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
inputPathisnullor whitespace.- FileNotFoundException
Thrown when the specified file does not exist.