Quantcast
Channel: HTML Renderer
Viewing all articles
Browse latest Browse all 693

New Post: PdfGenerator.GeneratePdf don't work

$
0
0
Good afternoon, I will discuss my situation ...

I use HtmlRenderer and PDFsharp to generate pdf from my application. Specifically use versions:
HtmlRenderer v1.5.0.6
PDFsharp v.1.50.3638.0

My problem is that in trying to generate the pdf document with the method:
PdfDocument pdf = PdfGenerator.GeneratePdf (htmlCode, PageSize.Letter); the error occurs:

An exception occurred in the type initializer 'TheArtOfDev.HtmlRenderer.PdfSharp.Adapters.GraphicsAdapter'.

The strange thing is that with previous versions of HtmlRenderer v.1.5.0.5 and PDFsharp v. 1.32.3057.0 worked perfectly.

My code is:
public byte[] GenerarPDFfromHTML(string htmlCode)
    {
        MemoryStream msBody = new MemoryStream();
        PdfDocument pdf = PdfGenerator.GeneratePdf(htmlCode, PageSize.Letter);
        pdf.Save(msBody, false);
        return msCuerpo.ToArray();
    }
I will appreciate your help.

Viewing all articles
Browse latest Browse all 693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>