1

I have a very big screenshot (48.69 x 1220.93 cm) which I’m converting to PDF using PDFBox 2.0.4.

It works well when I open the generated PDF using the Mac Preview app, but not with Adobe Reader version 2015. It shows only a long blank page and says the dimensions are 19.17 x 200 inches. I’m aware that early versions of the PDF spec had a limit of 200 inches height. So I've tried setting the pdf version to 1.7 but it didn’t work:

org.apache.pdfbox.pdmodel.PDDocument#setVersion
org.apache.pdfbox.cos.COSDocument#setVersion

Both Adobe and Preview say the version of the pdf is 1.7. I can normally open smaller pdfs using adobe.

demongolem
  • 9,474
  • 36
  • 90
  • 105
Frantzisko
  • 31
  • 1
  • 4
  • 1
    Please share the pdf. – Tilman Hausherr Dec 22 '16 at 16:03
  • @TilmanHausherr, [This is the pdf I'm talking about](https://www.dropbox.com/s/uz622k2gtcpm4u1/121882.pdf?dl=0) – Frantzisko Dec 22 '16 at 21:44
  • 1
    The media box is 1380 x 34609. 1 unit = 1/72 inch. So it's about 19" x 480" or 48cm x 1211cm thus your assumptions are correct. I looked into the PDF with NOTEPAD++ and it is indeed 1.7. It is displayed blank in Adobe Reader. I didn't try to click the yellow bar. It displays in properly in PDFBox and in two other java based products. It crashes in gsview but works in ghostscript alone. If you don't get a better answer / comment, I'd suggest you complain at Adobe. – Tilman Hausherr Dec 22 '16 at 23:14

1 Answers1

2

As @Tilman already said in his comment,

The media box is 1380 x 34609. 1 unit = 1/72 inch

Unfortunately this is beyond the size a specification conforming pdf reader has to support:

The minimum page size should be 3 by 3 units in default user space; the maximum should be 14,400 by 14,400 units. In versions of PDF earlier than 1.6, the size of the default user space unit was fixed at 1 ⁄ 72 inch, yielding a minimum of approximately 0.04 by 0.04 inch and a maximum of 200 by 200 inches. Beginning with PDF 1.6, the size of the unit may be set on a page-by-page basis; the default remains at 1/ 72 inch.

(Table C.1 – Architectural limits - ISO 32000-1)

To support a document page as large as desired here, one should use a larger default user space unit, e.g. 3/72".

mkl
  • 90,588
  • 15
  • 125
  • 265