HTML to PDF - page break with PdfSharp and HtmlRenderer

后端 未结 4 667
清酒与你
清酒与你 2020-12-28 17:16

I try to convert HTML to PDF using PdfSharp and HtmlRenderer. This is part of code:

private byte[] CreateHtmlContent()
{
    string htmlContent = File.ReadAl         


        
4条回答
  •  离开以前
    2020-12-28 18:13

    This is a little late, but I ran into the same issue. The problem is the margin set on the GeneratePdf call. Remove it and it's fine.

        PdfDocument pdf = PdfGenerator.GeneratePdf(htmlContent, PdfSharp.PageSize.A4);
    

提交回复
热议问题