I have this PDF file created by scanning. When viewing it in any PDF viewer, the page's width is greater than the height. But it seems like all the PDF applications I have tried mistake the width as the height and the height as the width for this PDF file (see below.)Why?Is the PDF file broken?How can I repair the PDF file so that the PDF applications don't mix its width and height?The following command shows the width is smaller than the height in  points:$ pdfinfo test.pdf Creator:        Xerox WorkCentre 7830Producer:       Xerox WorkCentre 7830CreationDate:   Tue Dec 23 00:22:47 2014Tagged:         noForm:           nonePages:          1Encrypted:      noPage size:      612 x 1008 ptsPage rot:       90File size:      81820 bytesOptimized:      noPDF version:    1.4The following command shows the width is smaller than the height in pixels:$ pdfimages -list test.pdf page   num  type   width height color comp bpc  enc interp  object ID---------------------------------------------------------------------   1     0 image     864  1400  rgb     3   8  jpeg   no         6  0   1     1 mask     1236   895  -       1   1  jbig2  no         8  0   1     2 mask      737   891  -       1   1  jbig2  no        10  0   1     3 mask      247   381  -       1   1  jbig2  no        11  0   1     4 mask       44   298  -       1   1  jbig2  no        12  0   1     5 mask      429     9  -       1   1  jbig2  no        13  0   1     6 mask       22   258  -       1   1  jbig2  no        14  0   1     7 mask      130   142  -       1   1  jbig2  no        15  0I am trying to crop away the left and right margins of the PDF file, using the script pdfcrop.shhere which seems basedon gs and pdftk. My measurements of the left and right margins are116 pts and 20 pts.The usage of the script says:  echo  -t \<left> [<top> [<right> <bottom>]]\  echo     trims outer page edges by the given amounts. Unit is bp. A single number  echo     is used for all trims, two numbers \<left> <top>\ are applied to the  echo     right and bottom trims alike.butpdfcrop.sh -t 116 0 20 0 test.pdf  trimmed.pdfwill crop the top by 116 pts and the bottom by 20 pts, while thefollowing does the correct thing by crop the left by 116 pts and theright by 20 pts.pdfcrop.sh -t 0 116 0 20 test.pdf  trimmed.pdf
All PDF applications mix the width and height of a PDF file
pdf;ghostscript;pdftk