Skip to content

PDFForm.flatten() does not handle rotated fields correctly #733

@Hopding

Description

@Hopding

PDF form fields can be rotated. However, the rotation logic for form field widgets should be "in-place" (see rotateInPlace), as opposed to the more common (at least in PDF land) logic of "about-the-origin" rotation. The current logic used in PDFForm.flatten() appears to be using "about-the-origin" logic, which leads to incorrect results after flattening a rotated field. See below for examples clarifying this:

✅ Correct Rendering of Rotated Fields

You can generate this document yourself by running yarn apps:node 17 and looking at the first page of the resulting document.

❌ Incorrect Rendering of Rotated Fields

You can generate this document yourself by running yarn apps:node 18 and looking at the fifth page of the resulting document.

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