Hello, when converting Email to PDF, the Headers do not appear in the PDF file. I am using Aspose Email 23.12. I was using Aspose.Email 6.0.0 before. Everything was OK.
Sample Code is below. Am I forgetting any settings?
MailMessage document;
public void convert(OutputStream outputStream) {
MhtSaveOptions so = new MhtSaveOptions();
so.setMhtFormatOptions(MhtFormatOptions.WriteOutlineAttachments);
so.getRenderingHeaders().add("From");
so.getRenderingHeaders().add("Date");
so.getRenderingHeaders().add("Reply-To");
so.getRenderingHeaders().add("To");
so.getRenderingHeaders().add("Subject");
// convert email to pdf
ByteArrayOutputStream tmpStream = new ByteArrayOutputStream();
ByteArrayOutputStream emailAsPdfStream = new ByteArrayOutputStream();
this.document.save(tmpStream, so);
LoadOptions loadOptions = new LoadOptions();
loadOptions.setLoadFormat(com.aspose.words.LoadFormat.MHTML);
com.aspose.words.Document word = new Document(new ByteArrayInputStream(tmpStream.toByteArray()), loadOptions);
word.save(emailAsPdfStream, com.aspose.words.SaveFormat.PDF);
com.aspose.pdf.Document pdf = new com.aspose.pdf.Document(new ByteArrayInputStream(emailAsPdfStream.toByteArray()));
pdf.save(outputStream);
}