简体   繁体   English

iText:如何检测pdf页面是LETTER还是LEGAL大小

[英]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. 我有一个包含LETTER和LEGAL大小混合的pdf文档,我需要检测具有LEGAL大小的页面并减少到LETTER大小。 Can I do this with iText? 我可以用iText这样做吗? sample code would be greatly appreciated. 示例代码将不胜感激。 Thank you so much. 非常感谢。

Either use 要么使用

Compare the width and height of the Rectangle you get out of this and you know what paper size you're using. 比较你得到的矩形的宽度和高度,你就知道你正在使用的纸张尺寸。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM