使用 IronPdf 生成 html 内容到 pdf,但是在 pdf 中生成 3 页页眉内容和页脚在单独的页面中,如何在单页洞内容中显示。
var Renderer = new IronPdf.HtmlToPdf();
//Renderer.PrintOptions.Header.DrawDividerLine = false;
//Renderer.PrintOptions.Footer.DrawDividerLine = false;
Renderer.PrintOptions.PaperSize = PdfPrintOptions.PdfPaperSize.A4;
Renderer.PrintOptions.CssMediaType = PdfPrintOptions.PdfCssMediaType.Screen;
Renderer.PrintOptions.PaperOrientation = PdfPrintOptions.PdfPaperOrientation.Portrait;
// Renderer.PrintOptions.MarginTop = 10; //millimeters
// Renderer.PrintOptions.MarginBottom = 10;
Renderer.PrintOptions.Zoom = 125;
//Renderer.PrintOptions.FirstPageNumber = 1;
Renderer.PrintOptions.CreatePdfFormsFromHtml = true;
Renderer.PrintOptions.FitToPaperWidth = true;
Renderer.PrintOptions.InputEncoding = Encoding.UTF8;
Renderer.PrintOptions.FitToPaperWidth = true;
pdf 将像这样生成:在此处输入图像描述