Hello, I will discuss my situation ...
I use PDFsharp to generate pdf from my application, for render code html y use HtmlRenderer specifically use versions:
PDFsharp v.1.50.3638.0 (PdfSharp.dll and PdfSharp.Charting.dll)
HtmlRenderer v1.5.0.6
When is generating the doc pdf show a exception:
An exception occurred in the type initializer 'TheArtOfDev.HtmlRenderer.PdfSharp.Adapters.GraphicsAdapter'
I can use any version of HtmlRenderer (HtmlRenderer v1.5.0.5 or HtmlRenderer v1.5.0.6) and works perfectly, every time I use the version of PDFsharp 1.32.3057.0. The problem only occurs when I upgrade to the version of PdfSharp.1.50.3638 beta.
One example of my code:
Code:
public byte[] GenerarPDFfromHTML(string htmlCode)
{
MemoryStream msBody = new MemoryStream();
PdfDocument pdf = PdfGenerator.GeneratePdf(htmlCode, PageSize.Letter);//Here the exception
pdf.Save(msBody, false);
return msCuerpo.ToArray();
}
will appreciate your help.