【发布时间】:2020-07-04 15:56:59
【问题描述】:
我正在尝试使用“Rotativa”库将HTML file 转换为 PDF,但是在使用自定义标题时我遇到了一些问题,这是我的代码:
string customSwitches = string.Format("--header-html \"{0}\" " +
"--header-spacing \"0\" " +
"--footer-html \"{1}\" " +
"--footer-spacing \"10\" " +
"--footer-font-size \"10\" " +
"--header-font-size \"10\" ", header, footer);
var invoice = new ViewAsPdf("Index", _invoiceRepository.GetInvoice(1))
{
FileName = "MyPDF.pdf",
CustomSwitches = customSwitches,
PageMargins = margin,
PageSize = size,
PageOrientation = orientation
};
return invoice;
页眉和页脚已按预期成功注入到每个页面的顶部和底部,但问题是页眉与其余内容重叠。 如何为页眉预留空间?
【问题讨论】:
标签: asp.net asp.net-mvc rotativa