If we convert a message body to PDF and the body contains a large image, the PDF is created with the full size image. Is ther a way to automaticly sale this image so that it wil fit on the PDF page? But only if the image would be otherwise croped.
I included an exampe msg, the generated mhtml and the generated PDF
FW testmail robot.zip (312.0 KB)
For demonstartion this is the PDF we would like to be produced:
FW testmail robot (resized).zip (813.7 KB)
This is the code of our application:
Aspose.Email.License license = new Aspose.Email.License();
license.SetLicense(@“Aspose.Total.lic”);
MemoryStream stream = new MemoryStream();
MhtSaveOptions opt = Aspose.Email.SaveOptions.DefaultMhtml;
opt.SaveAttachments = false;
theMessage.Save(stream, opt);
string htmlFileName = Path.Combine(outputPath, Path.ChangeExtension(Path.GetFileName(inputFileName), ".mhtml"));
theMessage.Save(htmlFileName, opt);
stream.Seek(0, SeekOrigin.Begin);
Aspose.Words.LoadOptions loadOptions = new Aspose.Words.LoadOptions();
loadOptions.LoadFormat = Aspose.Words.LoadFormat.Mhtml;
AsposeWordWithTimeout doc = new AsposeWordWithTimeout(inputFileName, stream, loadOptions);
doc.UpdateTableLayout();
Aspose.Words.Saving.PdfSaveOptions options = new Aspose.Words.Saving.PdfSaveOptions();
options.Compliance = PdfCompliance.Pdf15;
string outputFileName = Path.Combine(outputPath, Path.ChangeExtension(Path.GetFileName(inputFileName), ".pdf"));
doc.Save(fileName, saveOptions);