小编use*_*501的帖子

使用Rotativa生成PDF从页面中断数据的视图继续在第二页的标题上继续忽略CSS

我已经尝试了很多答案,并与结论没有甚至开发商自己,我有得到由一个复杂的模块中创建一个索引页答案出来了,视图接收与ActionAsPdf模块,并产生除了当页的PDF打破表继续在下一页覆盖表头顶部的记录.

public ActionResult PrintRoster(Guid id)
    {
        string footer = "--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\"";

        return new ActionAsPdf("RosterPDF", 
                            new { id = id }) { FileName = "ClassRoster.pdf",
                                                PageSize = Rotativa.Options.Size.A4,
                                                PageOrientation = Rotativa.Options.Orientation.Portrait,
                                                MinimumFontSize = 16,
                                                PageMargins = {Top = 15, Bottom = 22},
                                                PageHeight = 40,
                                                CustomSwitches = footer
                            };
    }
Run Code Online (Sandbox Code Playgroud)

创建RosterPDF然后生成有问题的PDF

@model Training.ViewModels.RosterViewModel
@using Training.UtilModels
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head> …
Run Code Online (Sandbox Code Playgroud)

html-to-pdf rotativa asp.net-mvc-5

1
推荐指数
1
解决办法
5535
查看次数

标签 统计

asp.net-mvc-5 ×1

html-to-pdf ×1

rotativa ×1