You can rotate individual pages in the viewer by calling PDFDocument.setRotationOffset. This sets a display-only rotation for the specified page — it’s applied in the viewer, but it isn’t written back to the PDF.

Setting a page’s rotation

Call setRotationOffset(pageIndex, rotation) on the document instance returned by getDocument():

await this.pdfRef.current?.getDocument().setRotationOffset(0, 90);
  • pageIndex: Zero-based page index of the page to rotate.
  • rotation: Rotation in degrees. Must be 0, 90, 180, or 270.

Resetting a page’s rotation

To reset a rotated page back to its original orientation, set its rotation offset to 0:

await this.pdfRef.current?.getDocument().setRotationOffset(0, 0);