Welcome Guest Search | Active Topics | Sign In | Register

System.Drawing.Common is not supported on this platform Options
Klaus O K
Posted: Tuesday, December 13, 2022 7:37:23 AM
Rank: Newbie
Groups: Member

Joined: 10/20/2022
Posts: 5
When trying to convert XML to PDF, I do this

PdfDocument pdfDocument = new PdfDocument();
HtmlToPdf.ConvertHtml(xml, pdfDocument);

where xml is a string.

I run it in Visual Studio, in a project targetting .NET 5.0
running on a pc running Windows 10 Enterprise version 20H2.

I get this error

EO.Pdf.HtmlToPdfException: 'Conversion failed. System.Drawing.Common is not supported on this platform.'

InnerException:
PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.
This exception was originally thrown at this call stack:
System.Drawing.Drawing2D.Matrix.Matrix(float, float, float, float, float, float)
EO.Pdf.Drawing.PdfMatrix.implicit operator System.Drawing.Drawing2D.Matrix(EO.Pdf.Drawing.PdfMatrix)
EO.Pdf.Drawing.PdfMatrix.Translate(float, float)
EO.Pdf.PdfDocument.wmao.ouoa(EO.Pdf.PdfPage, EO.Internal.ayvo, float?, bool)
EO.Pdf.PdfDocument.wmao.lbel(EO.Internal.ayvo, int)
EO.Pdf.PdfDocument.wmao.spbn()
EO.Internal.ayli.spbo(EO.Pdf.HtmlToPdfResult, EO.Pdf.PdfDocument, int)
EO.Internal.ayli.spbn(EO.Internal.aylj)

This, on the other hand, works:
HtmlToPdf.ConvertUrl(inputPath, outputPath);
eo_support
Posted: Tuesday, December 13, 2022 11:23:31 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,103
Hi,

Please check whehter your targeting OS is Windows. There are multiple versions of System.Drawing.Common.dll, it appears that your application loaded the wrong version. The version for Windows would not throw this exception.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.