iText PDF中首页和末页的页边距不同 [英] Different margins for first and last page in iText PDF

查看:452
本文介绍了iText PDF中首页和末页的页边距不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以为iText中的第一页和最后一页指定不同的页边距? 我有一个大页眉放在第一页,一个大页脚放在最后一页.

Is there a way to specify different margins for my first and last pages in iText? I have a large header to be placed in first page and a large footer to be present in the last page.

问题是当我完全定位页脚时,由于绝对定位,页面的内容可能会与之重叠.

The trouble is when I position the footer absolutely the content of the page might overlap it because of the absolute positioning.

推荐答案

是. 在创建最后一页之前,设置页边距,然后调用Document对象的newpage()方法.

yes. before creating last page, set margins and then call newpage() method of Document object.

这篇关于iText PDF中首页和末页的页边距不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆