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);
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
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!
|