繁体   English   中英

如何设置 PDF header 的高度,c# Z2567A5EC9705EB7AC2C984UsingE0NReco 应用程序中的页脚

[英]How to Set Height of a PDF header, footer in c# web application(Using NReco.PdfGenerator)

我正在开发 c# web 应用程序并使用 NReco.PdfGenerator 生成 pdf。 PDF 与 Header 和页脚生成良好。

我正在使用“PageHeaderHtml”和“PageFooterHtml”来生成 header 页脚。

现在我需要为 Header 和页脚设置特定的高度,以便邮件包含在这两者之间。 我怎样才能做到这一点

您需要使用 prperty NReco.PdfGenerator.PageMargins 设置顶部和底部边距,例如:

NReco.PdfGenerator.PageMargins margin = new NReco.PdfGenerator.PageMargins();
margin.Top = 20;
margin.Left = 0;
margin.Right = 0;
margin.Bottom = 20;

var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter();
 htmlToPdf.LowQuality = true;
 htmlToPdf.PageWidth = 210;
 htmlToPdf.PageHeight = 297;
 htmlToPdf.Margins = margin;
 htmlToPdf.PageHeaderHtml = htmlHeader;
 htmlToPdf.PageFooterHtml = htmlFooter;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM