Hello,
we convert MSG to PDF via MHTML. If I convert the msg in attached zip-file a get a >50MB Output. The MHTML has about 5MB.
Why does the PDF-file has such a size?
File: at-3.zip (4.9 MB)
Codepart:
MhtSaveOptions mhtmlSaveOptions = SaveOptions.getDefaultMhtml();
mhtmlSaveOptions.setMhtFormatOptions(0);
mapiMessage.save(baos, mhtmlSaveOptions);
bais = new ByteArrayInputStream(baos.toByteArray());
Document doc = new Document(bais, getDocLoadOptions());
Iterator<Section> sectionIt = doc.getSections().iterator();
while (sectionIt.hasNext()) {
Section sec = sectionIt.next();
PageSetup pageSetup = sec.getPageSetup();
pageSetup.setPaperSize(PaperSize.A4);
pageSetup.setTopMargin(ConvertUtil.millimeterToPoint(15));
pageSetup.setBottomMargin(ConvertUtil.millimeterToPoint(15));
pageSetup.setLeftMargin(ConvertUtil.millimeterToPoint(15));
pageSetup.setRightMargin(ConvertUtil.millimeterToPoint(15));
}
PdfSaveOptions options = new PdfSaveOptions();
options.setCompliance(PdfCompliance.PDF_A_1_A);
options.setOptimizeOutput(true);
doc.save(baos2, options);
return baos2.toByteArray();
Thanks in advance,
Josef