rschroll / rmrl

Render reMarkable documents to PDF
GNU General Public License v3.0
119 stars 21 forks source link

Annotations incorrectly placed in pages with CropBox or Rotate #2

Closed rschroll closed 3 years ago

rschroll commented 3 years ago

As reported in rschroll/rmfuse#3.

rschroll commented 3 years ago

Having looked at the file, I see three worrisome factors:

  1. The pages have a CropBox that is smaller than the MediaBox. This box is what the device uses to set the window, I expect. But our code uses the MediaBox to figure out the scale and landscape/portrait logic.
  2. The CropBox doesn't have a corner at (0,0). I'm not sure yet, but I suspect this may be leading to an offset of the annotations.
  3. The pages all have a rotation of 270, just to confuse everything further.

I don't think being landscape actually plays into this at all.