I try to convert HTML to PDF using PdfSharp and HtmlRenderer. This is part of code:
private byte[] CreateHtmlContent() { string htmlContent = File.ReadAl
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);