Converting any email (.msg/.eml) to PDF with “A4” size, (vertically) centers the content on the page.
Email to PDF centered.zip (81.1 KB)
The following code was used for conversion:
using (var conv = new Converter(documentPath))
{
var options = new PdfConvertOptions()
{
PageWidth = 750, // A4 width for portrait mode
PageHeight = 1061, // A4 height for portrait mode
MarginLeft = 15,
MarginRight = 15,
MarginBottom = 15,
MarginTop = 15
};
conv.Convert(Path.GetFileNameWithoutExtension(documentPath) + ".pdf", options);
}
To my surprise, when using GroupDocs.Total 24.9.1 package, the bug was fixed.
In my opinion, it should not matter if I use GroupDocs.Conversion 24.9 (or 24.10) or the total package.
The code was not changed, so it was using the same “GroupDocs.Converter” class and underlying Aspose.DLLs.
The real difference I could see between the outputs, was PDF version 1.7 for Total and PDF version 1.5 for Conversion.