mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
## Description PDFs can have pages that are rotated, which are correctly rendered in the frontend. However, when we load the PDF in the backend, the rotation is applied which causes issues when we want to insert fields. To account for this, we swap the width and height for pages that are rotated by 90/270 degrees. This is so we can calculate the virtual position the field was placed if it was correctly oriented in the frontend. Then when we insert the fields, we apply a transformation to the position of the field so it is rotated correctly. **Test document with 0/90/180/270 rotated pages** [rotated_test.pdf](https://github.com/user-attachments/files/15798138/rotated_test.pdf)