Reputation: 5670
I am creating a pdf from HTML using Rotativa, and my code looks like this
var CustomSwitches = "--footer-right \"Date: [date] [time]\" " + "--footer-center \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\"";
var rotativaOptions = new DriverOptions { CustomSwitches = CustomSwitches,PageSize = Size.A4};
return new ViewAsPdf("~/Views/Partials/Report/SummaryReportspdf.cshtml")
{
RotativaOptions = rotativaOptions
};
All looks good to me, but when there is more than one page, page breaks even. And it looks like below image
How can I solve this issue?
Upvotes: 0
Views: 1526
Reputation: 11
Syncfusion HTML to PDF converter in C# provides an option to convert HTML to PDF without text and image split across the pages. Refer the help documentation for more information
https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#split-text
Note: I work for Syncfusion.
Upvotes: -1
Reputation: 139
I solved this problem using the latest version of wkhtmltopdf (currently version 0.12.5)
You can download it from here: https://wkhtmltopdf.org/downloads.html
Hope it helps!
Upvotes: 2