Using GroupDocs.Conversion 25.4.0 in .NET 9 the attached image fails to convert with the following error.
img_0444.jpg (180.9 KB)
I’m also not sure why this has uploaded as .jpg it should be a .png
GroupDocs.Conversion.Exceptions.CorruptOrDamagedFileException: ‘Cannot convert. The file is corrupt or damaged. Could not load file or assembly ‘System.Drawing.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’. The system cannot find the file specified.’
The GroupDocs.Conversion 25.4 Nuget package has a dependency on an older version of System.Drawing.Common?
Conversion code:
LoadOptions GetLoadOptions(LoadContext context)
{
var loadOptions = new ImageLoadOptions()
{
Format = (ImageFileType)FileType.FromExtension(fileExtension)
};
return loadOptions;
}
var fs = new MemoryStream();
using var converter = new Converter(convertedFilePath, (lc) => GetLoadOptions(lc));
var convertOptions = new PdfConvertOptions();
converter.Convert(convertOptions, (Action<ConvertedContext>)(context =>
{
context.ConvertedStream.CopyTo(fs);
}));
fs.Seek(0, SeekOrigin.Begin);