Method ConvertAsync
- Namespace
- LMKit.Document.Conversion
- Assembly
- LM-Kit.NET.dll
ConvertAsync(byte[], bool, CancellationToken)
Converts an EML file (as a byte array) into a PDF attachment.
public static Task<Attachment> ConvertAsync(byte[] emlData, bool stripQuotes = false, CancellationToken cancellationToken = default)
Parameters
emlDatabyte[]The EML file content as a byte array.
stripQuotesboolWhen
true, quoted and reply content is removed from the email body.cancellationTokenCancellationTokenCancels the operation.
Returns
Examples
byte[] emlBytes = File.ReadAllBytes("invoice.eml");
Attachment pdf = EmlToPdf.Convert(emlBytes);
ConvertAsync(string, bool, CancellationToken)
Converts an EML file at the specified path into a PDF attachment.
public static Task<Attachment> ConvertAsync(string inputPath, bool stripQuotes = false, CancellationToken cancellationToken = default)
Parameters
inputPathstringThe file system path to the EML file.
stripQuotesboolWhen
true, quoted and reply content is removed from the email body.cancellationTokenCancellationTokenCancels the operation.
Returns
Examples
Attachment pdf = EmlToPdf.Convert("message.eml");
File.WriteAllBytes("message.pdf", pdf.GetData());