How can I achieve such a feature of PDF export?

I have Aspose Total for Java license, and I use Aspose Email and Aspose Word to make Email2PDF.

Recently I have such a new requirement:

An Email contains an inline Attachment picture and a non-inline Attachment picture, we need to convert this Email to PDF, only the inline Attachment picture should be kept in PDF, yet the non-inline Attachment picture should be excluded.

How can I achieve such an effect?

@zwei Looks like the question is related to Aspose.Email. I will move your question to the appropriate forum. my colleagues from Aspose.Email team will help you shortly.

Hello @zwei,

You can set the appropriate MhtFormatOptions to exclude the Outline Attachment:

MailMessage message = MailMessage.load(fileName);
MhtSaveOptions mhtSaveOptions = new MhtSaveOptions();
mhtSaveOptions.setMhtFormatOptions(mhtSaveOptions.getMhtFormatOptions() & ~MhtFormatOptions.WriteOutlineAttachments);
message.save(fileName+ ".mhtml", mhtSaveOptions);
1 Like

thank you very much! That is exactly what I want

@zwei ,

Thank you for contacting our support. If you have any further questions, feel free to ask.