You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2021/11/26 07:14:00 UTC

[jira] [Comment Edited] (PDFBOX-5332) media box size changes after addPage

    [ https://issues.apache.org/jira/browse/PDFBOX-5332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17449408#comment-17449408 ] 

Tilman Hausherr edited comment on PDFBOX-5332 at 11/26/21, 7:13 AM:
--------------------------------------------------------------------

I don't know yet your actual code, but your PDF has a media box not in the page itself, but in a parent (this is unusual but allowed), which means that pages without their own media box inherit it.
 !screenshot-1.png! 


was (Author: tilman):
While I don't know what happens with your code, your PDF has a media box not in the page itself, but in a parent (this is unusual but allowed).
 !screenshot-1.png! 

> media box size changes after addPage
> ------------------------------------
>
>                 Key: PDFBOX-5332
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5332
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Sally Oh
>            Priority: Major
>         Attachments: screenshot-1.png, 스크린샷, 2021-11-26 16-11-30.png, 실패하지 않는 책 스터디.pdf
>
>
> After addPage to a new PDDocument, it seems like that added page size is changed to 'Letter size'
> {code:java}
> val page = PDDocument.load(File(path).pages.get(0)
> println(page.mediaBox.height) // prints 540.0
> newPdf.addPage(page)
> println(newPdf.getPage(0).mediaBox.height) // prints 792.0{code}
> Every other pdf files I have doesn't have this issue but only this file.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org