开发者

iText: how to detect if a pdf page is LETTER or LEGAL size

I have a pdf documents that contains mixture of LETTER and LEGAL size, and I need to detect pages with LEGAL size and reduce to LETTER size. Can I do this with iText? sample code would be greatly appreciated. Thank you so much开发者_高级运维.


Either use

  • http://api.itextpdf.com/itext/com/itextpdf/text/pdf/PdfReader.html#getPageSize(int)
  • http://api.itextpdf.com/itext/com/itextpdf/text/pdf/PdfReader.html#getPageSizeWithRotation(int)

Compare the width and height of the Rectangle you get out of this and you know what paper size you're using.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜