Adjust page size
GroupDocs.Viewer allows setting output page size for rendering Email messages into HTML, PDF, and images. To enable this feature, the PageSize property of the EmailOptions class is used. The following are the pages sizes that are supported and provided in PageSize enumeration:
- Unspecified - The default, unspecified page size
- Letter - The size of the Letter page in points is 792 × 612
- Ledger - The size of the Ledger page in points is 1224 × 792
- A0 - The size of the A0 page in points is 3371 × 2384
- A1 - The size of the A1 page in points is 2384 × 1685
- A2 - The size of the A2 page in points is 1684 × 1190
- A3 - The size of the A3 page in points is 1190 × 842
- A4 - The size of the A4 page in points is 842 × 595
The following are the steps to set size for email message:
- Create HtmlViewOptions (or JpgViewOptions, or PngViewOptions, or PdfViewOptions) object;
- Set EmailOptions.PageSize value;
- Call View method.
using (Viewer viewer = new Viewer("sample.msg"))
{
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.EmailOptions.PageSize = PageSize.A4;
viewer.View(viewOptions);
}
More resources
View eMail Messages Online
Along with full-featured .NET library we provide simple but powerful free online Apps. View MSG and EML files online with GroupDocs Viewer App.
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
- GroupDocs.Viewer for .NET examples, plugins, and showcase
- GroupDocs.Viewer for Java examples, plugins, and showcase
- Document Viewer for .NET MVC UI Example
- Document Viewer for .NET App WebForms UI Modern Example
- Document Viewer for Java App Dropwizard UI Modern Example
- Document Viewer for Java Spring UI Example