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

Free Support Forum - aspose.com

Embedded image problem mhtml to Pdf using Aspose.Words

I have a msg file. I can convert msg file correctly to mhtml file. After that i convert mhtml to Pdf
using Aspose.Words. (With full licence)

First problem :
Embedded image is not shown on pdf file (but its shown on mhtml file(attached))
How can i fix this ?

Here is the code :

string fileName = openFileDialog1.FileName;

var message = Aspose.Email.Mail.MailMessage.Load(fileName);
using (var msgStream = new MemoryStream())
{
message.Save(msgStream, Aspose.Email.Mail.MailMessageSaveType.MHtmlFromat);
message.Save("c:\\test.mhtml", Aspose.Email.Mail.MailMessageSaveType.MHtmlFromat);
msgStream.Position = 0;

var options = new Aspose.Words.LoadOptions();
options.LoadFormat = Aspose.Words.LoadFormat.Mhtml;
var document = new Aspose.Words.Document(msgStream, options);

foreach (Aspose.Words.Tables.Table table in document.GetChildNodes(NodeType.Table, true))
{
//table.PreferredWidth = PreferredWidth.FromPercent(100);
table.PreferredWidth = PreferredWidth.FromPercent(100);
}

string path = "c:\\test.pdf";

document.Save(path, new Aspose.Words.Saving.PdfSaveOptions());
Hi,

Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 13.4.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-8240. Your request has also been linked to this issue and you will be notified as soon as it is resolved.

Sorry for the inconvenience.

Best regards,

Hi Awais,

I fixed this doing these steps :

1- Convert msg file to mhtml file using Aspose.Words

2- Convert mhtml file to html file using Aspose.Words
(While converting to html file,images are automatically exported)

3-Convert html file to pdf using Aspose.Pdf.Generator

Hi,

It's great you were able to find what you were looking for. Please let us know any time you have any further queries. We are always glad to help you.

Best regards,

The issues you have found earlier (filed as WORDSNET-8240) have been fixed in this Aspose.Words for .NET 16.12.0 update and this Aspose.Words for Java 16.12.0 update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.