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

Free Support Forum - groupdocs.com

MHT to PDF conversion - Not supported file type error in .NET

Hello, when I try to convert MHT to PDF I get Not supported file type
Could you please help me?
Version: 21.8.0
It’s file:MHT - MHTML Document (2).7z (7.2 KB)

1 Like

@vitaliy.honcharuk

We cannot reproduce this issue at our end. Please have a look at this output.pdf (74.8 KB). Could you please share the sample code?

Stream document = GetDoc();

using (var fileConverter = new Converter(() => document))
                        {
                            var convertedDocumentStream = new ConvertedDocumentStream((converted) =>
                            {
                                converted.CopyTo(result);
                                converted.Dispose();
                            });
                             fileConverter.Convert(() => new MemoryStream(), convertedDocumentStream, GetPdfOptions());
        }
1 Like

@vitaliy.honcharuk

This issue is reproduced at our end. If you load the source file (not as a stream), you will get the resultant PDF successfully. However, we’ve logged this issue in our internal issue tracking system with ticket ID CONVERSIONNET-4954. It’ll be now further investigated. You’ll be notified about the outcomes.

1 Like

The issues you have found earlier (filed as CONVERSIONNET-4954) have been fixed in this update. This message was posted using Bugs notification tool by nikola.yankov

1 Like

Hello for my MHT file I see the same issue with updated version 21.11.0

@vitaliy.honcharuk

Could you please share the problematic MHT?

MHT - MHTML Document (3).7z (7.2 KB)
this one

Stream document = GetDoc();

using (var fileConverter = new Converter(() => document))
{
var convertedDocumentStream = new ConvertedDocumentStream((converted) =>
{
converted.CopyTo(result);
converted.Dispose();
});
fileConverter.Convert(() => new MemoryStream(), convertedDocumentStream, GetPdfOptions());
}

@vitaliy.honcharuk

We are looking into this scenario. You will be notified about the outcomes.

@vitaliy.honcharuk

Could you please share your .NET version?

.net version is 4.6

@vitaliy.honcharuk

We still cannot reproduce this issue at our end using API version 21.11 or 22.1 and .NET version 4.5.1. Could you please tell us about your development environment (e.g. OS name/version)? We’d appreciate if you share a screencast/video covering this issue or steps to reproduce this issue.