Free Support Forum - aspose.com

MHT to PDF conversion

Hi,

We are using the latest version of Aspose Total for .Net framework.

We have been facing some issues while converting a MHT file to PDF. Below are the scenarios which we have tried and issues associated with the respective scenarios.

Scenario 1:

Converting the MHT file to PDF by reading the MHT file using the Aspose.Network into a stream and loading the stream into Aspose.Words and saving the document as PDF .

Issue:

  1. The conversion take a really long time to generate the pdf file.
  2. The final pdf output displays the entire HTML code rather than the actual formatted content.

Scenario 2:

Manually converted the MHT file to HTML and used Aspose.PDF to convert the HTML file to PDF.

Issue:

The Final PDF output lost all the formatting of tables (borders, colours, images inside the table)

The MHT file is attached for reference. We require a solution for both the above scenarios.

We are currently working on very tight schedule and would appreciate a quick response for the issue.

Thanks

Vikram

Hello Vikram,

Thanks for your interest in our products.

We are working over this query and will get back to you soon. We apologize for your inconvenience.

Hi,

Any updates on this issues?

Thanks and Regards

Vikram Kumar D.

Hello Vikram,

I have tried converting the MHT file into PDF format using InLineHTML approach but I am afraid Aspose.Pdf for .NET does not seem to support MHT format and the resultant PDF does not seem to be correct. For the sake of correction, I have logged this problem as PDFNEWNET-29919 in our issue tracking system. We will further look into the details of this problem and see how we can fix this issue. We will definitely keep you posted on the status of correction. We apologize for your inconvenience.

Besides this, when MHT file is converted into HTML format, all the formatting of the PDF document is lost so I think it might not be viable to convert it into PDF format. Even after I have converted the HTML file into PDF format, the result is not correct.

Regarding Scenario 1, where you are using Aspose.Network to read the contents of MHT file and placing the contents inside Aspose.Words object, I think the representative from respective team would be in better position to answer this query. For your convenience, I am moving this thread to respective forum. Soon you will be updated with the status of correction. We are really sorry for your inconvenience.

Hi Vikram,

Thanks for your inquiry.

I am a representative for Aspose.Words. I exported your MHT message using Aspose.Network + Aspose.Words and was able to reproduce the extra HTML content.

However I tried loading the MHT using Aspose.Words on its own and did not encounter the issue (however the images were not present) so I assume this issue is to do with Aspose.Network.

I will welcome the Aspose.Network team to investigate this issue further.

Thanks,

Hi Adam,

When you converted the MHT using Aspose.Words, were the tables, borders and background coluors in the tables properly formatted as it was appearing in the MHT file? We did try this and found that the table formatting were lost.

If it is possible can you send us the sample code which you had tried for the conversion along with the sample output as well. It will be of some help for us.

Thanks and Regards

Vikram Kumar D.

Hi Nayyer,

Can you provide us with a tentative date for the fix?

This is something which we require in our application and are really hard pressed for time.

Would appreciate if you can expedite this fix and get back to us as soon as possible.

Thanks and Regards

Vikram Kumar D.

Hello Vikram,

As we just have been able to notice this issue, so it would be bit difficult to estimate the timelines by which it will be resolved. However our development team is looking into the details of this problem and as soon as we have made some definite progress towards the resolution of this problem, we would be more than happy to update you with the status of correction. Please be patient and spare us little time. We apologize for your inconvenience.

Hi Vikram,

Thanks for your inquiry.

Of course, please see the attached code below and output files. As you can see all formatting is retained during conversion. The only issue is that the tables expand further then the page, which is expected as the tables in HTML are quite large. Even MS Word does not import these properly.

You can fix this up a bit by adjusting the page size/orientation and fitting tables to the page width. Please see the articles http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-change-page-setup-for-whole-document.html and http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-autofit-a-table-to-page-width.html for details.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Converting with both:
MailMessage message = MailMessage.Load("email.mht");

message.Save("Aspose.Network Out.mht", MessageFormat.Mht);

Document doc = new Document("Aspose.Network Out.mht”);

doc.Save("Aspose.Network + Aspose.Words Out.pdf");

Converting with Aspose.Words only:

Document doc = new Document("email.mht”);

doc.Save("Aspose.Words Out.pdf");

Thanks,

Hi,

Any updates on this issue please?

Thanks and Regards

Vikram Kumar D.

Hi

Thanks for your request. Unfortunately, the issue is still unresolved. We will keep you informed regarding its status and immediately let you know once it is resolved. I apologize for inconvenience.

Best regards,

Hi Vikram,

Thanks for your patience.

Concerning to PDFNEWNET-29919, Aspose.Pdf for .NET team is still working hard to get this issue fixed and I am afraid its not yet completely resolved. Nevertheless I have requested the development team to share the ETA regarding its resolution. Soon you will be updated with the status of correction. We apologize for this delay and inconvenience.

Hi,

Do you have an ETA for this issue. We are still waiting on this and any information on when this will be resolved will be of greate help.

Thanks,

Vikram Kumar D.

Hi Vikram,

Thanks for your patience.

Our development team is working hard to get these issues fixed but I am
sorry to inform you that PDFNEWNET-29919 is not yet completely resolved. Due to some technical difficulties, I am afraid currently we might not be able to share the ETA regarding their
resolution. Please be patient and spare us little time.

PS, Mean while I have sent an intimation to the development team to share any news regarding its resolution.

Hi,

Any updates on this issue please? We have been waiting for this solution for quiet sometime and really hope it will be resolved. Please give us a tentative date on the resolution please.

Thanks

Vikram Kumar D.

Hi Vikram,

As per our current estimate, we plan to include this feature in Q4 of 2011. Please be patient and spare us little time. We are sorry for this delay and inconvenience.

The issues you have found earlier (filed as PDFNEWNET-29919) have been fixed in Aspose.Pdf for .NET 9.0.0. Check the Blog post for further details.


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

Hi Vikram,


Thanks for your patience. We would like to update you that Aspose.Pdf has implemented the MHT to PDF feature in Aspose.Pdf for .NET 9.0.0. Please check following documentation link for the purpose.


Please feel free to contact us for any further assistance.

Best Regards,

The issues you have found earlier (filed as WORDSNET-5144) have been fixed in this .NET update and this Java update.


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