PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Exception when generate PdfDocument
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3122
Page 1 of 1

Author:  aerwalow [ Thu Jun 04, 2015 9:59 pm ]
Post subject:  Exception when generate PdfDocument

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.

Author:  () => true [ Sat Jun 06, 2015 6:28 pm ]
Post subject:  Re: Exception when generate PdfDocument

The HtmlRenderer is a third party tool. I never tried it.
Please contact the authors of HtmlRenderer. They may need your HTML code to replicate the problem.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/