Aspose.PDF.Drawing is referencing System.Drawing.Common

Previously it looks like Aspose.Drawing was being used to support linux but in the latest (24.11.0) version of Aspose.PDF.Drawing it is referencing System.Drawing.Common again so get build conflicts now

The type ‘ImageFormat’ exists in both ‘Aspose.Drawing, Version=24.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ and 'System.Drawing.Common, Version=7.0.0.0,

Here are the listed dependencies for Aspose.PDF.Drawing 24.11.0

My code is trying to use the PdfConverter object to convert the document, so basically

        PdfConverter converter = new PdfConverter();
        ...
        converter.GetNextImage(imageDataStream, System.Drawing.Imaging.ImageFormat.Png, 100);

This is where the ImageFormat conflict comes in.

What am I missing?

Thanks

Believe I figured it out after looking at the latest docs, looks like you don’t use PdfConverter anymore you use the different ImageDevices (i.e. PngDevice) and have it do the conversion.

@parzival
Conflicts can be resolved using aliases.
Something like this:

#if ASPOSE_PDF_DRAWING
using SysDrawing::System.Drawing;
using SysDrawing::System.Drawing.Printing;
using Margins = SysDrawing::System.Drawing.Printing.Margins;
#else
using System.Drawing;
using System.Drawing.Printing;
using Margins = System.Drawing.Printing.Margins;
#endif

System.Drawing is used in Aspose.Pdf.Drawing only for document printing. I wrote about this here.