Skip to end of metadata
Go to start of metadata
Contents Summary

This feature is supported by version 18.5 or greater.

The code uses some of the objects defined in Working with Common Operations.

Setting Page Size when Rendering Email Message

GroupDocs.Viewer allows setting output page size for rendering Email messages into PDF and images. To enable this feature, the setPageSize() method of the EmailOptions class is used. Please note that in HTML based rendering the whole email message is rendered into one responsive HTML page and setPageSize() option will not influence the rendering. The following are the pages sizes that are supported and provided in PageSize Enumeration:

  • Unknown - 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 ImageOptions/PdfFileOptions
  • Set EmailOptions.setPageSize()
  • Call getPages() method

Rendering as Image

Rendering as PDF

Labels
  • No labels