Skip to content
DemoSampleAPI ReferenceFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Conversion Options ​

Set conversion options with CEmailOptions. A new instance holds the default values.

csharp
CEmailOptions options = new CEmailOptions();
// Show Bcc recipients in addition to the default options
options.Flags |= CEmailFlags.EMAIL_INCLUDE_BCC;
// Maximum input email size
options.MaxInputBytes = 20UL * 1024 * 1024;

using (CEmailResult result = CEmailConverter.ConvertToPdf("/mail.eml", "/mail.pdf", CEmailFormat.EMAIL_FORMAT_AUTO, options))
{
}
Option (CEmailFlags)DefaultDescription
EMAIL_INCLUDE_HEADERSOnShow the sender, recipients, Cc, date, subject and other headers at the top
EMAIL_INCLUDE_ATTACHMENT_LISTOnShow the attachment list after the body
EMAIL_EXPORT_ATTACHMENTSOnWrite attachments to the attachments/ directory during ExportHtml, with download links in the HTML attachment list
EMAIL_INLINE_RESOURCESOffEmbed body resources such as images as data URIs where possible
EMAIL_RECOVER_EMLOffEnable bounded EML recovery, for example a missing closing multipart boundary. Recovered results are not guaranteed to be complete
EMAIL_INCLUDE_BCCOffShow Bcc recipients
PropertyDefaultDescription
MaxInputBytes100 MiBMaximum input email size. 0 means a limit of 0, not unlimited
MaxDecodedBytes256 MiBMaximum total decoded data size
MaxHtmlBytes64 MiBMaximum output HTML size
IsCancellednullCancel callback; return true to cancel. It is only checked between phases and between I/O blocks, cannot interrupt a single parse or layout, and is not a hard timeout. An exception thrown by the callback is treated as a cancellation