> For the complete documentation index, see [llms.txt](https://mostafaznv.gitbook.io/pdf-optimizer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mostafaznv.gitbook.io/pdf-optimizer/advanced-usage/configuring-ghostscript/autorotatepages.md).

# AutoRotatePages

<table><thead><tr><th width="182">Method Name</th><th width="159.33333333333331">Argument Name</th><th>Argument Type</th></tr></thead><tbody><tr><td>autoRotatePages</td><td>mode</td><td>Mostafaznv\PdfOptimizer\Enums\AutoRotatePages</td></tr></tbody></table>

Allows Distiller to automatically orient (rotate) pages based on the predominant text orientation. autorotation is not done if the file contains the <mark style="color:red;">%%ViewingOrientation</mark> DSC comment and <mark style="color:red;">ParseDSCComments</mark> is true.

If <mark style="color:red;">AutoRotatePages</mark> is set to <mark style="color:red;">None</mark>, pages are not automatically oriented and the <mark style="color:red;">%%ViewingOrientation</mark> DSC comment is ignored.
