I am using Aspose Total 24.4.1
Our code for Email2PDF is
public static void email2pdf(final String emailFilename, final String targetPDFname, final Properties properties) throws Exception
{
final MailMessage message = MailMessage.load(emailFilename);
final String temp = "TempHtmlOutput.mhtml";
// exclude non-inline Attachment PDF export
MhtSaveOptions mhtSaveOptions = new MhtSaveOptions();
mhtSaveOptions.setMhtFormatOptions(mhtSaveOptions.getMhtFormatOptions() & ~MhtFormatOptions.WriteOutlineAttachments);
message.save(temp, mhtSaveOptions);
final Document document = new Document(temp);
document.getSections().forEach(s -> {s.getPageSetup().setPaperSize(PaperSize.A4);});
final boolean isPdfA = Boolean.parseBoolean(
properties.getProperty(DocumentConverterConstants.PARAM_PDFA_VIA_OFFICE, DocumentConverterConstants.PARAM_PDFA_VIA_OFFICE_VALUE_TRUE))
&& properties.getProperty(DocumentConverterConstants.PARAM_PDFA) != null &&
!properties.getProperty(DocumentConverterConstants.PARAM_PDFA).isEmpty();
if (isPdfA)
{
final PdfSaveOptions opts = new PdfSaveOptions();
opts.setCompliance(PdfCompliance.PDF_A_1_A);
document.save(targetPDFname, opts);
}
else
{
document.save(targetPDFname, SaveFormat.PDF);
}
final File file = new File(temp);
file.delete();
}
Here is our test Email file and PDF output:
test.zip (1,4 MB)
As you can see, part of the inline picture disappears on the PDF export.
How can I get the whole picture on the PDF export?