PageSize of PDF always the same between landscape and portrait with itextpdf

后端 未结 2 1715
情深已故
情深已故 2021-01-25 19:58

I have a PDFReader which contains some page in landscape mode and other in portrait.

I need to distinct them to do some treatment... However, if I call the getOrientatio

2条回答
  •  太阳男子
    2021-01-25 20:25

    Fix :

    use

    PdfStamper.getImportedPage(pdfReader, pagenumber).getBoundingBox().getWidth()
    

    instead of

    stamper.getOverContent(i).getPdfDocument().getPageSize().getWidth();
    

提交回复
热议问题