Free Support Forum -

Rtf-msg to mhtml: attached images inside mhtml


if I convert a rtf-mail via into mhtml, the attached images are also shown inside mhtml (and lateron in pdf). Is there a possibility to NOT include them into pdf?

File: (3.1 MB)

Chrysanthemum.jpg and Desert.jpg are Attachments. This one should NOT be shown in PDF.

ByteArrayOutputStream baos = new ByteArrayOutputStream();
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
ByteArrayInputStream bais = null;
MhtSaveOptions mhtmlSaveOptions = SaveOptions.getDefaultMhtml();
mhtmlSaveOptions.setMhtFormatOptions(0);, mhtmlSaveOptions);
bais = new ByteArrayInputStream(baos.toByteArray());
Document doc = new Document(bais, getDocLoadOptions());
PdfSaveOptions options = new PdfSaveOptions();
options.setOptimizeOutput(true);, options);
return baos2.toByteArray();




Thank you for contacting Aspose support team.

This issue is observed and logged under Id:EMAILJAVA-34384 for detailed analysis. You will be automatically notified once any update is ready to share.