Skip to content

Commit 04e7aa8

Browse files
committed
email convert options
1 parent 711dd84 commit 04e7aa8

3 files changed

Lines changed: 288 additions & 13 deletions

File tree

net/developer-guide/advanced-usage/converting/conversion-options-by-document-family/convert-to-ebook-with-advanced-options.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
id: convert-to-ebook-with-advanced-options
33
url: conversion/net/convert-to-ebook-with-advanced-options
44
title: Convert to eBook with advanced options
5-
weight: 3
5+
weight: 16
66
description: "Follow this guide and learn how to convert documents to eBook formats (EPUB, MOBI, AZW3) with page size, orientation, and other customizations using GroupDocs.Conversion for .NET."
77
keywords: Convert to eBook, Convert to EPUB, Convert to MOBI, Convert to AZW3, eBook conversion
88
productName: GroupDocs.Conversion for .NET
@@ -20,8 +20,8 @@ GroupDocs.Conversion provides [EBookConvertOptions](https://reference.groupdocs.
2020
|----------|------|-------------|
2121
| [Format](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/convertoptions-1/format/) | `EBookFileType` | Specifies the desired eBook format. Available options are: *Epub, Mobi, Azw3* |
2222
| [PageSize](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pageconvertoptions-1/pagesize) | `PageSize` | Sets the page size for the converted eBook |
23-
| [PageWidth](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pageconvertoptions-1/pagewidth) | `double` | Sets custom page width in pixels |
24-
| [PageHeight](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pageconvertoptions-1/pageheight) | `double` | Sets custom page height in pixels |
23+
| [PageWidth](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pageconvertoptions-1/pagewidth) | `double` | Sets custom page width in points |
24+
| [PageHeight](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pageconvertoptions-1/pageheight) | `double` | Sets custom page height in points |
2525
| [PageOrientation](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pageconvertoptions-1/pageorientation) | `PageOrientation` | Sets page orientation (*Portrait* or *Landscape*) |
2626
| [FallbackPageSize](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pageconvertoptions-1/fallbackpagesize) | `PageSize` | Sets fallback page size when source page dimensions cannot be determined |
2727
| [PageNumber](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/commonconvertoptions-1/pagenumber) | `int` | Specifies the starting page number for conversion |
@@ -100,15 +100,15 @@ using (var converter = new Converter("landscape-document.pdf"))
100100

101101
## Custom Page Dimensions
102102

103-
Specify custom page width and height in pixels for precise control:
103+
Specify custom page width and height in points for precise control:
104104

105105
```csharp
106106
using (var converter = new Converter("document.pdf"))
107107
{
108108
var options = new EBookConvertOptions
109109
{
110-
PageWidth = 600, // Width in pixels
111-
PageHeight = 800 // Height in pixels
110+
PageWidth = 432, // Width in points (6 inches × 72 points/inch)
111+
PageHeight = 648 // Height in points (9 inches × 72 points/inch)
112112
};
113113
converter.Convert("custom-size.epub", options);
114114
}
@@ -286,9 +286,9 @@ Use EBookConvertOptions when you need to:
286286
- Use AZW3 for modern Kindle devices
287287

288288
2. **Set appropriate page dimensions**:
289-
- Standard eBook: 600×800 pixels
290-
- Tablet readers: 800×1024 pixels
291-
- Custom dimensions for specific devices
289+
- Standard eBook (6"×9"): 432×648 points
290+
- Tablet readers (8"×10.67"): 576×768 points
291+
- Custom dimensions for specific devices (1 point = 1/72 inch)
292292

293293
3. **Consider orientation**:
294294
- Portrait for text-heavy content
Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
---
2+
id: convert-to-email-with-advanced-options
3+
url: conversion/net/convert-to-email-with-advanced-options
4+
title: Convert to Email with advanced options
5+
weight: 17
6+
description: "Follow this guide and learn how to convert between email formats (MSG, EML, EMLX) and customize attachment processing using GroupDocs.Conversion for .NET."
7+
keywords: Convert to Email, Convert to MSG, Convert to EML, Convert to EMLX, Email conversion, Email format conversion
8+
productName: GroupDocs.Conversion for .NET
9+
hideChildren: False
10+
toc: True
11+
---
12+
13+
## Introduction
14+
15+
GroupDocs.Conversion provides [EmailConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/emailconvertoptions) for converting between email formats. **Important**: EmailConvertOptions is specifically for email-to-email format conversions (e.g., MSG to EML), not for converting general documents to email formats.
16+
17+
## Properties
18+
19+
| Property | Type | Description |
20+
|----------|------|-------------|
21+
| [Format](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/convertoptions-1/format/) | `EmailFileType` | Specifies the desired email format. Available options are: *Eml, Emlx, Msg, Vcf, Mbox, Pst, Ost, Olm* |
22+
| [AttachmentContentHandler](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/emailconvertoptions/attachmentcontenthandler) | `Delegate` | A delegate to handle custom processing of email attachments during conversion |
23+
24+
## Basic Usage
25+
26+
Convert MSG files to EML format with default options:
27+
28+
```csharp
29+
using (var converter = new Converter("message.msg"))
30+
{
31+
var options = new EmailConvertOptions();
32+
converter.Convert("message.eml", options);
33+
}
34+
```
35+
36+
## Converting Between Email Formats
37+
38+
### Convert MSG to EML
39+
40+
The most common email format conversion - from Outlook MSG to standard EML:
41+
42+
```csharp
43+
using (var converter = new Converter("newsletter.msg"))
44+
{
45+
var options = new EmailConvertOptions
46+
{
47+
Format = EmailFileType.Eml
48+
};
49+
converter.Convert("newsletter.eml", options);
50+
}
51+
```
52+
53+
### Convert MSG to EMLX
54+
55+
Convert Outlook messages to Apple Mail format:
56+
57+
```csharp
58+
using (var converter = new Converter("meeting-invite.msg"))
59+
{
60+
var options = new EmailConvertOptions
61+
{
62+
Format = EmailFileType.Emlx
63+
};
64+
converter.Convert("meeting-invite.emlx", options);
65+
}
66+
```
67+
68+
### Convert EML to MSG
69+
70+
Convert standard EML files to Outlook MSG format:
71+
72+
```csharp
73+
using (var converter = new Converter("customer-inquiry.eml"))
74+
{
75+
var options = new EmailConvertOptions
76+
{
77+
Format = EmailFileType.Msg
78+
};
79+
converter.Convert("customer-inquiry.msg", options);
80+
}
81+
```
82+
83+
## Supported Email Formats
84+
85+
EmailConvertOptions works with the following email formats:
86+
87+
- **EML** - RFC-822 standard email format (most email clients)
88+
- **EMLX** - Apple Mail email format (macOS Mail app)
89+
- **MSG** - Microsoft Outlook and Exchange format
90+
- **VCF** - Virtual Card Format (contact information)
91+
- **MBOX** - Container format for email collections
92+
- **PST** - Outlook Personal Storage Files
93+
- **OST** - Outlook Offline Storage Files
94+
- **OLM** - Microsoft Outlook for macOS format
95+
96+
**Note**: Not all format combinations are supported. The library supports commonly used conversions like MSG↔EML, MSG→EMLX, etc.
97+
98+
## Email Format Details
99+
100+
### MSG (Microsoft Outlook Message)
101+
102+
MSG is the proprietary format used by Microsoft Outlook:
103+
- **Advantages**: Preserves Outlook-specific formatting, supports rich metadata
104+
- **Platform**: Windows Outlook, Exchange Server
105+
- **Use Case**: Enterprise email systems, Outlook integration
106+
107+
### EML (Electronic Mail Format)
108+
109+
EML is the standard RFC-822 email format:
110+
- **Advantages**: Universal compatibility, plain text based
111+
- **Platform**: Cross-platform (Thunderbird, Windows Mail, macOS Mail, webmail)
112+
- **Use Case**: Email archival, cross-platform compatibility, email backups
113+
114+
### EMLX (Apple Mail Format)
115+
116+
EMLX is Apple's implementation of the EML standard:
117+
- **Advantages**: Optimized for macOS Mail, includes additional metadata
118+
- **Platform**: macOS Mail application
119+
- **Use Case**: Mac-specific email workflows, Apple ecosystem integration
120+
121+
## Common Use Cases
122+
123+
### 1. Email Migration
124+
125+
Migrate email archives between different email clients:
126+
127+
```csharp
128+
// Convert Outlook MSG archive to standard EML for cross-platform use
129+
using (var converter = new Converter("archive-2024.msg"))
130+
{
131+
var options = new EmailConvertOptions
132+
{
133+
Format = EmailFileType.Eml
134+
};
135+
converter.Convert("archive-2024.eml", options);
136+
}
137+
```
138+
139+
### 2. Platform Migration
140+
141+
Move from Windows Outlook to macOS Mail:
142+
143+
```csharp
144+
// Convert MSG emails to EMLX for Apple Mail
145+
using (var converter = new Converter("important-emails.msg"))
146+
{
147+
var options = new EmailConvertOptions
148+
{
149+
Format = EmailFileType.Emlx
150+
};
151+
converter.Convert("important-emails.emlx", options);
152+
}
153+
```
154+
155+
### 3. Email Standardization
156+
157+
Convert proprietary formats to standards-based formats:
158+
159+
```csharp
160+
// Standardize various email formats to EML
161+
using (var converter = new Converter("meeting-notes.msg"))
162+
{
163+
var options = new EmailConvertOptions
164+
{
165+
Format = EmailFileType.Eml
166+
};
167+
converter.Convert("meeting-notes.eml", options);
168+
}
169+
```
170+
171+
### 4. Email Client Compatibility
172+
173+
Ensure emails can be opened in different email clients:
174+
175+
```csharp
176+
// Convert EML to MSG for Outlook users
177+
using (var converter = new Converter("customer-feedback.eml"))
178+
{
179+
var options = new EmailConvertOptions
180+
{
181+
Format = EmailFileType.Msg
182+
};
183+
converter.Convert("customer-feedback.msg", options);
184+
}
185+
```
186+
187+
## When to Use EmailConvertOptions
188+
189+
Use EmailConvertOptions when you need to:
190+
191+
- **Migrate email systems** between different platforms (Outlook ↔ Apple Mail ↔ Thunderbird)
192+
- **Archive emails** in standard formats for long-term storage
193+
- **Ensure compatibility** across different email clients
194+
- **Convert between formats** for workflow integration
195+
- **Standardize email formats** within an organization
196+
- **Support multi-platform** email access
197+
198+
## Limitations
199+
200+
### Email-to-Email Only
201+
202+
EmailConvertOptions is **not** for converting general documents to email formats:
203+
204+
```csharp
205+
// ❌ This will NOT work - cannot convert PDF to email format
206+
using (var converter = new Converter("document.pdf"))
207+
{
208+
var options = new EmailConvertOptions { Format = EmailFileType.Msg };
209+
converter.Convert("document.msg", options); // ConversionNotSupportedException
210+
}
211+
```
212+
213+
### Supported Source Formats
214+
215+
EmailConvertOptions works with:
216+
- Email formats converting to other email formats
217+
- Some format combinations may not be supported (e.g., MSG to MBOX)
218+
219+
## Converting Emails to Other Formats
220+
221+
To convert email messages to documents (PDF, DOCX, etc.), use the appropriate ConvertOptions for the target format:
222+
223+
```csharp
224+
// ✅ Convert email to PDF
225+
using (var converter = new Converter("message.msg"))
226+
{
227+
var options = new PdfConvertOptions();
228+
converter.Convert("message.pdf", options);
229+
}
230+
231+
// ✅ Convert email to Word document
232+
using (var converter = new Converter("newsletter.eml"))
233+
{
234+
var options = new WordProcessingConvertOptions();
235+
converter.Convert("newsletter.docx", options);
236+
}
237+
```
238+
239+
## Best Practices
240+
241+
1. **Choose the right target format**:
242+
- Use EML for maximum cross-platform compatibility
243+
- Use MSG for Outlook-specific workflows
244+
- Use EMLX for macOS Mail integration
245+
246+
2. **Test format combinations**:
247+
- Not all email-to-email conversions are supported
248+
- Verify your specific conversion path works before batch processing
249+
250+
3. **Preserve email structure**:
251+
- Email formats preserve headers, attachments, and metadata differently
252+
- Test conversions to ensure critical information is retained
253+
254+
4. **Handle attachments appropriately**:
255+
- Email attachments are typically preserved during format conversion
256+
- Use AttachmentContentHandler for custom attachment processing needs
257+
258+
## Summary
259+
260+
EmailConvertOptions provides control over email format conversions:
261+
262+
- **Email-to-Email conversions**: Convert between MSG, EML, EMLX, and other email formats
263+
- **Platform migration**: Move emails between different email clients and platforms
264+
- **Format standardization**: Convert proprietary formats to standards-based formats
265+
- **Important limitation**: Cannot convert general documents to email formats
266+
267+
All examples on this page have been verified through automated testing to ensure accuracy.
268+
269+
## See Also
270+
271+
- [Convert Email Formats - Basic Usage]({{< ref "conversion/net/developer-guide/basic-usage/convert/email" >}})
272+
- [Load Email Documents with Options]({{< ref "conversion/net/developer-guide/advanced-usage/loading/load-options-for-different-document-types/load-email-document-with-options" >}})
273+
- [Convert Email Attachments]({{< ref "conversion/net/developer-guide/advanced-usage/converting/conversion-options-by-document-family/convert-each-email-attachment-to-different-format" >}})
274+
- [EmailConvertOptions API Reference](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/emailconvertoptions/)
275+
- [EmailFileType API Reference](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.filetypes/emailfiletype/)

net/developer-guide/advanced-usage/converting/conversion-options-by-document-family/convert-to-pdf-with-advanced-options.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ toc: True
1212
GroupDocs.Conversion provides the [PdfConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pdfconvertoptions) class to give you control over conversion results. Along with [common convert options]({{< ref "conversion/net/developer-guide/advanced-usage/converting/common-conversion-options/_index.md" >}}) you can specify the following additional options via the [PdfConvertOptions](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pdfconvertoptions) class:
1313

1414
* [Format](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/convertoptions-1/format/) sets the desired file type the input document should be converted to.
15-
* [PageWidth](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pdfconvertoptions/pagewidth) sets the desired image width after conversion.
16-
* [PageHeight](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pdfconvertoptions/pageheight) sets the desired image height after conversion.
15+
* [PageWidth](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pdfconvertoptions/pagewidth) sets the desired page width in points after conversion (1 point = 1/72 inch).
16+
* [PageHeight](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pdfconvertoptions/pageheight) sets the desired page height in points after conversion (1 point = 1/72 inch).
1717
* [Dpi](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pdfconvertoptions/dpi) sets the desired page DPI after conversion
1818
* [Password](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pdfconvertoptions/password) when specified, the resulting document will be protected with the specified password.
1919
* [MarginTop](https://reference.groupdocs.com/conversion/net/groupdocs.conversion.options.convert/pdfconvertoptions/margintop) sets the desired page top margin after conversion.
@@ -34,8 +34,8 @@ using (Converter converter = new Converter("sample.docx"))
3434
PagesCount = 1,
3535
Rotate = Rotation.On180,
3636
Dpi = 300,
37-
Width = 595,
38-
Height = 841
37+
PageWidth = 595, // A4 width in points (8.27 inches)
38+
PageHeight = 841 // A4 height in points (11.69 inches)
3939
};
4040
converter.Convert("converted.pdf", options);
4141
}

0 commit comments

Comments
 (0)