I’ve tested this with the tag set to value = 6. (which equals “Rotate 90 CW”)
https://www.exiftool.org/
I’ve used the exiftool to change the Orientation tag of an image like this:
"& '.\exiftool(-k).exe' -Orientation=6 -n exiftest.jpg"
After having done this the image is rotated (90 degres related to original image). And then i insert this (newly rotated) image into a new email using Outlook. (selecting the file from disk)
I then send this e-mail to myself. Save the e-mail received in my inbox as .msg and I get an msg-file where the image is incorrecly rotated back when converted to pdf.
It looks like the image is rotated back 90 deg again, but it seems like something goes wrong with the aspect as well. Keep in mind that it should not be rotated at all by Aspose.
And the weird thing is that this does NOT happen when using the online tool you provide: https://products.aspose.app/email/conversion/msg
Then it is converted flawlessly.
It DOES happen when converting the MSG to JPG using the same online tool, but selecting .jpg as output.
It also happens when using code like this:
// Converting using Aspose.Mail and Aspose.Words
using MailMessage mail = MailMessage.Load("inputFile.msg");
using var ms = new MemoryStream();
mail.Save(ms, SaveOptions.DefaultMhtml);
var loadOptions = new Aspose.Words.Loading.LoadOptions() { LoadFormat = Aspose.Words.LoadFormat.Mhtml };
var document = new Aspose.Words.Document(ms, loadOptions);
document.Save("outputFile.pdf", new Aspose.Words.Saving.PdfSaveOptions());
//or like this using Aspose.Mail and Aspose.PDF (This is a direct copy from your documentation: https://products.aspose.com/total/net/conversion/msg-to-pdf/)
MailMessage message = MailMessage.Load("sourceFile.msg");
// save MSG as a HTML
message.Save("HtmlOutput.html", SaveOptions.DefaultHtml);
// load HTML with an instance of Document
Document document = new Document("HtmlOutput.html");
// call save method while passing SaveFormat.Pdf
document.Save("output.pdf", SaveFormat.Pdf);
We obviously need to use code similar to the above so the fact that it works int the online tool does not help us.
PS: This does not happen with .PNG images containing the same “Orientation” exif tag/value.
See attached ZIP for .msg and .pdf
test06.zip (262.6 . KB)