I just downloaded trial version to make sure before purchasing.
What is the code that converts msg file to pdf file?
The attached files should be converted to pdf format and appended the main pdf file.
The attached file can be txt, doc/docx, xls/xlsx, ppt/pptx, pdf, rft, and image files.
Thanks,
Chang Shin
Hi Chang,
We are sorry for a delayed response.
Aspose.Email supports handling attachments however for conversion of these attachments to PDF requires some other Aspose products as well.
For extracting the attachments from email messages, sample code can be found at link . Once the attachments are extracted, next step is to convert them into PDF. For this purpose you may please consider the following links which contain respective sample code.
For images and text
http://www.aspose.com/docs/display/pdfjava/Technical+Articles
For PPTX to PDF
For PPT to PDF
For Excel to PDF
For Word to PDF
Your target can be achieved by using Aspose.Email in conjunction with Aspose.Pdf for Java and above mentioned products according to the requirement. If you face any problem while conversion to PDF, please contact our experts at Aspose.Pdf Product forum who will further assist you to create final PDF.
Please feel free to write us back if you have any other query related to Aspose.Email as we will be more than happy to assist you as much as possible.
Hi Kashif,
I downloaded “MsgToOtherFormats.java” code to test msg file.
How do we convert the attached files ( xls, doc, ppt, pdf,image file, vcard, and ical) automatically?
Do you have a example code?
Thanks,
Chang Shin
Hi Chang Shin,
It is some codes what I want to convert the attachment files.
…
AttachmentCollection ac = message.getAttachments();
for ( int i = 0; i < ac.size(); i++ ) {
Attachment attachment = (Attachment)ac.get(i);
System.out.println(“attachment, object=”+attachment.getName());
//InputStream is = attachment.getContentStream();
// How to append/insert this attached file (InputStream) to document?
}
document.save(strDocFile, SaveFormat.PDF);
Thanks,
Chang Shin
Hi Chang Shin,
Thanks,
Chang Shin