如何使用 iText7 设置 pdf 文档第一页的上边距?

How can I set top margin of the first page of pdf document using iText7?

我想设置第一页的上边距。不幸的是它不起作用。我尝试了 document.SetTopMargin(100) 但它设置了所有页面。我只想设置我的第一页。

下一页的边距必须在分页前设置。

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"));