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