Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 当有多个页面时,Rotativa会中断HTML_C#_.net_Pdf_Rotativa - Fatal编程技术网

C# 当有多个页面时,Rotativa会中断HTML

C# 当有多个页面时,Rotativa会中断HTML,c#,.net,pdf,rotativa,C#,.net,Pdf,Rotativa,我正在使用Rotativa从HTML创建pdf,我的代码如下所示 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\"";

我正在使用Rotativa从HTML创建pdf,我的代码如下所示

     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
    };
对我来说一切都很好,但当有超过一页的时候,这一页就扯平了。如下图所示


如何解决此问题?

我使用最新版本的wkhtmltopdf(当前版本为0.12.5)解决了此问题

您可以从这里下载:

希望有帮助

Syncfusion提供了一个选项,可以将HTML转换为PDF,而无需跨页面分割文本和图像。有关更多信息,请参阅帮助文档

注:我为Syncfusion工作