[英]How can I set top margin of the first page of pdf document using iText7?
I want to set top margin of my first page.我想设置第一页的上边距。 Unfortunately it doesn't work.
不幸的是它不起作用。 I tried the
document.SetTopMargin(100)
but that sets all pages.我尝试了
document.SetTopMargin(100)
但它设置了所有页面。 I just want to set my first page.我只想设置我的第一页。
The margin for the next page has to be set before the page break.下一页的边距必须在分页符之前设置。
document.SetTopMargin(100);
document.Add(new Paragraph("Text on first page"));
document.SetTopMargin(0);
document.Add(new AreaBreak(AreaBreakType.NEXT_PAGE));
document.Add(new Paragraph("Text on second page"));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.