Apache PDFBox - Rotate Pages
๐ง Operation Name
Apache PDFBox - Rotate Pages
rotatePages
๐งพ Description
Rotates one or more pages in a PDF document clockwise by 90, 180, or 270 degrees. You can optionally limit the rotation to specific pages using a page range.
โ
Inputs
PDF File [Binary]
InputStream
(Binary)
โ
The PDF file to rotate.
Degrees
Integer
โ
The rotation angle: must be one of 90
, 180
, or 270
.
Page Range
String
โ (Optional)
A comma-separated list of pages and/or ranges to rotate (e.g., 1,3,5-6
). If not provided, all pages will be rotated.
๐ค Output
Payload:
InputStream
(Binary) A new binary PDF stream with the specified pages rotated.Attributes:
PdfBoxFileAttributes
Includes original PDF metadata such as:numberOfPages
title
,author
, etc.
๐งช MuleSoft Flow Example
Hereโs how to call this operation in a MuleSoft flow:
This example uses both Filter and Rotate as our test pdf is password protected so we use a filter to effectively make a copy
๐ Notes
Degrees must be one of:
90
,180
, or270
. Other values will trigger a validation error.If
pageRange
is omitted, all pages will be rotated.Rotation is applied clockwise from the current orientation.
Useful for correcting scanned documents or preparing them for display.
Underlying Application Interface:
Last updated