Document Rotation
Saving a Document Page Rotation
Document page rotations are stored on the document record and do not actually modify the PDF file; however, downloading the document within DocViewer will preserve the rotations.
Getting a Document's Rotations
When launching a DocViewer session, the jwt-signed session body will include a rotations
property.
This property is a JSON object with keys representing page numbers and values representing the page's rotation in degrees. If a document
doesn't have any page rotations the rotations
property will be an empty JSON object.
{
// other session parameters ...
rotations: { '0': 90 }
}
Who Can Rotate a Document Page
Rotating a document does not require any special write permissions - anyone who can view the document can rotate it.
Rotating a Document Caveats
- A document page cannot be rotated if the page in question has any annotations on it. This will result in an error from the API.
- Making a PUT annotation request and supplying a rotation value that does not match the rotation value of the document record will result in an error from the API. This can happen when a user opens up a session and receives the document rotations from the server, but someone else rotates the document during this session. The rotation on the client and the rotation on the server can get out of sync - so sending the client's rotation to be compared against the server's rotation allows us to ensure that the annotation will be drawn in the correct spot.