We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

On behalf of from line still has a problem

I just tested the 4.0.0 version.
It is not correct to convert to mhtml format.
The on behalf of should be in the from line, not top position.
also 4.0.0 changed some code from 3.9.0.
you should let us know what codes are changed.
We can’t send this email file because of company policy.
Please let me know.

Thanks,
Chang Shin







Hi Chang,


We are sorry for the inconvenience caused to you.

I have reported the issue of unwanted information display at top of MHTML to our development team as NETWRKJAVA-33366. Once there is an update available in this regard, we’ll inform you here via this thread.

The information required with respect to changes in Aspose.Email for Java 4.0.0 is as follow. Please let us know if we can be of any additional help to you in this regard.
  • MapiTask.getReminderFileParameter(
  • MapiTask.getReminderSet()
  • MapiTask.getReminderTime()
  • MapiTask.setReminderFileParameter(java.lang.String)
  • MapiTask.setReminderSet(boolean)
  • MapiTask.setReminderTime(java.util.Date)
  • MailMessageSaveOptions.NoEncodeCharactersToMht
  • FolderInfo.getContents(com.aspose.email.MailQuery)
  • FolderInfo.addFile(java.lang.String,java.lang.String)
  • FolderInfo.getSubFolders(com.aspose.email.MailQuery)

I just tested 4.1.0 email version. The mhtml format is ok.
but this code still has top extra line:

com.aspose.words.Document document = new com.aspose.words.Document(baseFolder + htmlFileName);
document.save(baseFolder +“temp/” + tempPdfFileName, SaveFormat.PDF);

The email sample file is attached.

Thanks,
Chang Shin

The issues you have found earlier (filed as NETWRKJAVA-33366) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Chang,


The MailMessageSaveOptions has been enhanced with a flag to control the writing to extra print header to output MHTML, which is then converted to PDF. Please try the following code sample to avoid printing extra print header to the PDF and let us know your feedback.

Sample Code:

String dir = “EMAIL_544635\”;<o:p></o:p>

MailMessage msg = MailMessage.load(dir + "Declined Ingersoll-Rand Company Limited @ Mon Feb 24 2014 12pm - 1pm (changsub shin@gmail com).msg");

int saveOptions = MailMessageSaveOptions.WriteHeaderToMht | MailMessageSaveOptions.HideExtraPrintHeader;

msg.save(dir + "output.mhtml", MailMessageSaveType.getMHtmlFormat() ,saveOptions);

com.aspose.words.Document document = new com.aspose.words.Document(dir + "output.mhtml");

document.save(dir + "output.pdf", SaveFormat.PDF);

The MHTML file is ok with or without this option MailMessageSaveOptions.HideExtraPrintHeader . But the document.save does not work.
I am using java total version and the word version is “aspose-words-14.4.1-jdk16.jar”.

//message.save](https://message.save/)(baseFolder + htmlFileName, MailMessageSaveType.getMHtmlFormat(), MailMessageSaveOptions.HideExtraPrintHeader);
message.save(baseFolder + htmlFileName, MailMessageSaveType.getMHtmlFormat(), MailMessageSaveOptions.None);

com.aspose.words.Document document = new com.aspose.words.Document(baseFolder + htmlFileName);

document.save(baseFolder +“temp/” + tempPdfFileName, SaveFormat.PDF);

The MHTML and the final pdf file are attached.

Thanks,
Chang Shin

Hi Chang,


Could you please verify that the output generated with the latest version of Aspose.Email for Java and the following sample code still contains the extra information on top of the output PDF? I have tested this scenario with Aspose.Email for Java 4.1.0 and Aspose.Words for Java 14.4.1 and the output PDF doesn’t have any extra print header on top of PDF as you can see inn the attached PDF here. Please let us know your feedback to assist you further.

Sample Code:

String dir = “EMAIL_544635\”;<o:p></o:p>

MailMessage msg = MailMessage.load(dir + "Declined Ingersoll-Rand Company Limited @ Mon Feb 24 2014 12pm - 1pm (changsub shin@gmail com).msg");

int saveOptions = MailMessageSaveOptions.WriteHeaderToMht | MailMessageSaveOptions.HideExtraPrintHeader | MailMessageSaveOptions.WriteCompleteEmailAddressToMht;

msg.save(dir + "output.mhtml", MailMessageSaveType.getMHtmlFormat() ,saveOptions);

com.aspose.words.Document document = new com.aspose.words.Document(dir + "output.mhtml");

document.save(dir + "output.pdf", SaveFormat.PDF);


Getting worse. The headers are created twice.
I told you the mhtl is ok with “message.save(baseFolder + htmlFileName, MailMessageSaveType.getMHtmlFormat(), MailMessageSaveOptions.None);” code.
but com.aspose.words.Document document = new com.aspose.words.Document(baseFolder + htmlFileName);
document.save(baseFolder +“temp/” + tempPdfFileName, SaveFormat.PDF);
has the extra line.



These are Aspose libraries I use.

Thanks,
Chang Shin


Hi Chang,


I have tried this issue at my end with exactly the same code that you have provided but I am afraid to share that I could not observe any extra line or From address in the output PDF. Could you please provide us with a sample Java project containing the sample code that we can use at our end to observe this issue. We’ll look into it and assist you further.

I can’t upload the sample java project due to this your server error:
The Eclipse java project zip file size is almost 60 MB.

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.


Thanks,
Chang Shin

Hi Chang,


Please compress (zip or rar) the folder and attach to this post for our reference. In case you face the same error, you can place your sample project over Dropbox or Google Drive and share the link with us. We’ll look into it for assisting you further.

Please use this URL to download project jar file.

https://drive.google.com/file/d/0B-WiRoVbQllgaGloV0kzTWIyMWc/edit

Thanks,
Chang Shin

Hi Chang,

Thank you for your patience and providing the sample project.

I have tested your sample code and modified it slightly to hide the extra header in the resultant PDF. Could you please give it a try and let us know your feedback?

String baseFolder = “D:/Aspose/”;
String msgFileName = “Declined.msg”;
String htmlFileName = “Declined.mhtml”;
String pdfFileName = “Declined.pdf”;
MailMessageLoadOptions loadOptions = new MailMessageLoadOptions();
loadOptions.setMessageFormat(MessageFormat.getMsg());
MailMessage message = MailMessage.load(baseFolder + msgFileName, loadOptions);
TimeZone timezone = TimeZone.getTimeZone(“America/Los_Angeles”);
double offset = timezone.getOffset(Calendar.ZONE_OFFSET);
// checking offset value for date
Calendar c = Calendar.getInstance(timezone); // omit timezone for default tz
c.setTime(message.getDate()); // your date; omit this line for current date
int dateOffsetInt= c.get(Calendar.DST_OFFSET);
int offSetint = Double.valueOf(offset).intValue()+dateOffsetInt;
offset = Double.parseDouble(offSetint + “”);
message.setTimeZoneOffset(offset);
MhtMessageFormatter mhtlFormat = new MhtMessageFormatter();
mhtlFormat.setDateTimeFormat(“EEEE, MMMM dd, yyyy hh:mm:ss a”);

//Changes Start
int formatOptions = MhtFormatOptions.HideExtraPrintHeader | MhtFormatOptions.WriteCompleteEmailAddressToMht;
mhtlFormat.format(message, formatOptions);
//mhtlFormat.format(message);
//Changes End

message.save(baseFolder + htmlFileName, MailMessageSaveType.getMHtmlFormat(), MailMessageSaveOptions.None);
com.aspose.words.Document document = new com.aspose.words.Document(baseFolder + htmlFileName);
document.save(baseFolder + pdfFileName, com.aspose.words.SaveFormat.PDF);
System.out.println(“it is done.”);

Hi Chang,


Since the intermediate MHTML file generated has proper header indentations, this seems something to be investigated by Aspose.Words team as the conversion to PDF is done using Aspose.Words. Could you please create a new thread on Aspose.Words forum and share the issue for their consideration?

I created the thread for Words team. but I can’t understand why I have to create a new thread for Words team. you are same company.

Thanks,
Chang Shin

Hi Chang,


You were requested to create a new thread as this post had got too many replies that may lead to difficulty in investigating the issue. Since you have already created a new post in Aspose.Words forum, we’ll soon assist you further in this regard.

Hi Chang,

This issue has been logged into our issue tracking system as WORDSNET-10159. We will keep you updated on this issue in this thread. Sorry for the inconvenience.

Best Regards,

We still have this issue regarding "on behalf of"
The sample message file is ok. but some email message file has “on behalf of"
I use 'aspose-email-4.1.0.0-jdk16.jar”.
We can’t share the email message file because of company policy.




Thanks,
Chang Shin

Hi Chang,


Thank you for writing to Aspose support team.

I am afraid to share but without a sample message file, we won’t be able to investigate the issue in detail and assist you further. Please provide us with a sample message file for our investigation and assisting you further. Also, if this is a new issue that is different from the one logged under this thread, please create a new thread and provide your sample message file on that new thread for our investigation. We appreciate your cooperation in this regard.