# Rotate pages in a PDF

Rotate selected pages of a PDF by a fixed angle, in a Power Automate flow. No code to write, and no document is stored after the run.

Use this action to rotate one or more pages in a PDF document.

<PowerAutomateAction
  title="Rotate pages in a PDF"
  caption="Rotate pages in a PDF."
  connection="PDF Blocks Next"
  fields={[
    { label: "File Content", kind: "token", value: "File Content", required: true },
    { label: "Angle", kind: "select", value: "90", options: ["0", "90", "180", "270", "-90", "-180", "-270"], required: true },
    { label: "Pages", placeholder: "The pages to rotate, as a comma-separated list of page numbers" },
    { label: "First Page", placeholder: "First page to rotate (legacy)", advanced: true },
    { label: "Last Page", placeholder: "Last page to rotate (legacy)", advanced: true },
  ]}
/>

<ConnectorNotice kind="parameter" />

## Parameters

<ParamField name="File Content" type="File" required>
  The content of the input PDF document.
</ParamField>

<ParamField name="Angle" type="Integer Number" required>
  The angle of rotation of the page or pages. Valid values are 0, 90, 180, 270, -90, -180, or -270. Positive numbers rotate clockwise. Negative numbers rotate counter-clockwise.
</ParamField>

<ParamField name="Pages" type="String">
  The pages to rotate, as a comma-separated list of page numbers and ranges (for example `1..3,5`). A negative number counts from the end, so `-1` is the last page. Leave empty to rotate every page. This field is optional. Do not combine it with First Page / Last Page.
</ParamField>

<ParamField name="First Page" type="Integer Number">
  The page number of the first page to rotate in the PDF document. This field is optional. The value is 1 or more. This is a legacy field kept for backward compatibility; prefer Pages, and do not combine it with Pages.
</ParamField>

<ParamField name="Last Page" type="Integer Number">
  The page number of the last page to rotate in the PDF document. This field is optional. The value is 1 or more. This is a legacy field kept for backward compatibility; prefer Pages, and do not combine it with Pages.
</ParamField>

## Response

<ParamField name="Rotated PDF File Content" type="File">
  The content of the PDF document with some pages rotated. You can use it as an input to other actions in your flow.
</ParamField>

## Related actions

<CardGroup cols={2}>

<Card title="Reverse pages" href="/docs/power-automate/reverse-pages-of-pdf">
  Flip the page order of the document.
</Card>

<Card title="Reorder pages" href="/docs/power-automate/reorder-pages-of-pdf">
  Rearrange pages into a new order.
</Card>

<Card title="Extract pages" href="/docs/power-automate/extract-pages-from-pdf">
  Keep only some pages.
</Card>

<Card title="Remove pages" href="/docs/power-automate/remove-pages-from-pdf">
  Drop pages you no longer need.
</Card>

</CardGroup>
