0

I am using OpenHtmlToPdf. Is it possible to add 1 page as last page of document. I have read all document but found noting.

The following is the same code to generate pdf document.

 string html = Utils.ReadFile(@"C:\inetpub\wwwroot\pdf.html");
        html = html.Replace("###BODY###", "DYNAMIC CONTENT");
        var pdf = Pdf
            .From(html)
            .OfSize(PaperSize.A4)
            .WithTitle("PDF Report With Logo")
            .WithoutOutline()
            .WithObjectSetting("header.htmlUrl", "http://localhost/header.htm")
            .WithObjectSetting("footer.htmlUrl", "http://localhost/footer.htm")
            .WithObjectSetting("web.defaultEncoding", "utf-8")                
            .Landscape()
            .Comressed()
            .Content();
Kaushik Thanki
  • 3,334
  • 3
  • 23
  • 50

1 Answers1

1

If your last page is also based on html, you can add a page brake to your final html and then add page itself:

html += $"<div style=\"page-break-after: always;\"></div>{your_last_page}";
Roman.Pavelko
  • 1,555
  • 2
  • 15
  • 18