Rotativa 라이브러리에서 생성 된 PDF에 머리말과 꼬리말을 지정하려고합니다. 작성자가 here으로 대답 했으므로 CSS를 사용하여 가능해야합니다 (here). 그러나, 나는 이것을 할 수 없다.Rotativa에서 생성 된 PDF에 머리말과 꼬리말을 표시합니다.
나는 메타 태그에로드 된 스타일이 있습니다
<link href="print.css" rel="stylesheet" type="text/css" media="print" />
을 그리고 하단의 스타일 시트 :
public ActionResult ShowPdf()
{
var model = new Model();
return new ViewAsPdf("view.cshtml", model)
{
FileName = "Report.pdf",
CustomSwitches = "--print-media-type"
};
}
그리고 :
@page {
@top-left {
content: "TOP SECRET";
color: red
}
@bottom-right {
content: counter(page);
font-style: italic
}
}
그리고 다음으로 PDF를 생성 그러면 PDF 머리글 및 바닥 글에 아무 것도 나타나지 않습니다. 어떤 아이디어?
그냥 테스트하고 필요하지 않은' --print-media-type' – Kendrome