I am using NReco.PdfGenerator.HtmlToPdfConverter to convert my html text to a pdf and everything seems fine except one thing:
I want to print a line below my page header and it doesn't show it. Have I put it in the wrong place?
public byte[] CreatePdfContent(string htmlContent, string title)
{
var generator = new NReco.PdfGenerator.HtmlToPdfConverter
{
Orientation = NReco.PdfGenerator.PageOrientation.Portrait,
Margins = new PageMargins() { Bottom = 30, Left = 20, Right = 20, Top = 30 },
LowQuality = true,
PageHeaderHtml = $@"<div style='border-bottom: 1px solid #e5e5e5;width: 500px;text-align: left;'>{title}</div>"
};
return generator.GeneratePdf(htmlContent);
}
I mean, if I take out my div and run it as a normal html code, it works and prints a line below my title but in my pdf it only prints the text without the line.
<div style='border-bottom: 1px solid #e5e5e5;width: 500px;text-align: left;'>title</div>