Skip to content

Page Rotation Metadata is not applied correctly #34

@oallw

Description

@oallw

When rotating pages by changing the Page Rotation metadata, the fields have the wrong position and wrong orientation.

Investigation: formalpdf renders rotated pages correctly as landscape. The ML model returns normalized coordinates (x_n, y_n) relative to that landscape image. But rect_for() converts using the raw mediabox as if the image were portrait. So scaling is wrong and the axes are transposed.

Example

Image

Reproduce

  • Original file with pages rotated in Mac Preview (p. 7-14): 2074.pdf
  • File with incorrectly detected fields: 2074-form-output.pdf
  • Run commonforms 2074.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions