.NET 9 - Fails to identify document is PDF/HTML and convert

Hello,

I have attached a .zip file containing some files (1x .htm, 2x .pdf) - using .NET 9 and GroupDocs.Conversion 25.4.0 - none of these file convert. Their Format is also not detected correctly when using .GetDocumentInfo() method.

All files seem to work correctly when using your online file conversion app.

If you require any more information, please let me know.

Failing Documents.zip (43.4 KB)

Thanks

@rthomas95

Could you please provide more details about the specific error messages or behaviors you are encountering when trying to convert the files using .NET 9 and GroupDocs.Conversion?

Conversion error:

GroupDocs.Conversion.Exceptions.ConversionNotSupportedException: 'Conversion from () to pdf (PDF) is not supported

Conversion code:

using (Converter converter = new Converter(() => stream))
{
	var info = converter.GetDocumentInfo();
	var possibleConv = converter.GetPossibleConversions();

	var convertOptions = new PdfConvertOptions
	{
		PdfOptions = new PdfOptions
		{
			PdfFormat = PdfFormats.Default
		}
	};

	converter.Convert(convertOptions, (Action<ConvertedContext>)(context =>
	{
		context.ConvertedStream.CopyTo(outputFile);
	}));
}

@rthomas95
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CONVERSIONNET-7710

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@rthomas95

Could you please share a console application using that issue could be reproduced at our end? We couldn’t reproduce it using API version 25.4. Also share the development environment details e.g. OS and it’s version.

Hello,

I also can’t replicate it in a console application. I think this issued is caused when the Stream is a type of

Microsoft.AspNetCore.Http.ReferenceReadStream

When I manually copy this to a normal MemoryStream before hand it works correctly.

I am happy to work with this solution.

1 Like

@rthomas95

It’s great to hear that using a MemoryStream resolves the issue.