Search code examples
pdfadobepdfboxacrobatadobe-illustrator

PDF Rectangle[re] display position differs from object position in PDF document


There are two rectangles

two rectangles

on the page.

Page Contents:

/OC /MC0 BDC
  0.087 0.963 0.488 0.002 k
  0 0 0 0 K
  /GS0 gs
  118.442 63.791 61.046 133.721 re
  B
  92.977 141.837 21.744 55.674 re
  B
EMC

The actual Y position of the left (little) rectangle is higher [141.837], than right (big) rectangle.

Y position of the left _(little)_ rectangle

Why do they displays like they have similar Y position?

P.S.: transformation matrix [CTM] of the left rectangle is standard

standart

I tried to get actual coordinates (from pdf page content stream) and then put it to the new file. The result is here

I wish to know why left rectangle displays on Y=53.988 and not on Y=141.337


Solution

  • In PDF the default coordinate system is located in bottom left corner, the Y is relative to bottom margin, not top.

    63+133 = 141 + 55 (same top Y)

    Glad to see you are using our XFINIUM.PDF Inspector to look inside the PDF files. The PDF bounds are relative to standard PDF coordinate system, the Display bounds are relative to top left corner of the visible page area.