Rotate PDF Pages API
Start building for free today – no credit card required.
Easily rotate pages in your PDF documents to the desired orientation with our API. Specify the pages and rotation angle, and our API adjusts them instantly. Perfect for correcting page alignment, enhancing readability, or customizing layouts programmatically.
Claude, ChatGPT, Cursor or your own agent can call
rotate-pdf-pages directly.
Benefits of our PDF Page Rotate API
Adjust the orientation of your PDF pages with precision using our flexible PDF Page Rotate API.
Rotate individual pages to the desired angle for optimal readability and presentation.
Whether correcting misaligned scans or customizing the layout of your documents, our
API ensures consistent formatting and professional results while seamlessly fitting
into your document workflow.
Read our API documentation to learn how to rotate pages from PDFs.
Multi-language Code Example
curl -X POST https://apdf.io/api/pdf/page/rotate \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d rotations[0][angle]="-90" \
-d rotations[0][pages]="1-3" \
-d rotations[1][angle]="+180" \
-d rotations[1][pages]="z"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('rotations[0][angle]', '-90');
data.append('rotations[0][pages]', '1-3');
data.append('rotations[1][angle]', '+180');
data.append('rotations[1][pages]', 'z');
fetch('https://apdf.io/api/pdf/page/rotate', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/page/rotate', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'rotations[0][angle]' => '-90',
'rotations[0][pages]' => '1-3',
'rotations[1][angle]' => '+180',
'rotations[1][pages]' => 'z'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/page/rotate',
{
'file' => 'FILE_URL',
'rotations[0][angle]' => '-90',
'rotations[0][pages]' => '1-3',
'rotations[1][angle]' => '+180',
'rotations[1][pages]' => 'z'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/page/rotate',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'rotations[0][angle]': '-90',
'rotations[0][pages]': '1-3',
'rotations[1][angle]': '+180',
'rotations[1][pages]': 'z'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"rotations[0][angle]": "-90",
"rotations[0][pages]": "1-3",
"rotations[1][angle]": "+180",
"rotations[1][pages]": "z"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/page/rotate")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("rotations[0][angle]", "-90")
.add("rotations[0][pages]", "1-3")
.add("rotations[1][angle]", "+180")
.add("rotations[1][pages]", "z")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/page/rotate")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
No-Code PDF Page Rotation
Integrate our PDF API with Zapier Webhooks to automate your PDF page rotation workflows effortlessly. Whether you're correcting misaligned scans or adjusting the layout of reports, you can trigger PDF page rotation from hundreds of apps supported by Zapier. Automatically rotate pages to the desired orientation, ensuring consistent formatting and eliminating manual adjustments.
Rotate pages tutorials
Fix Sideways PDF Scans: Auto-Rotate Pages with Python
Learn how to automatically fix sideways or upside-down PDF pages from mobile uploads. Using Python and the Apdf Rotate API, you can detect and correct orientation issues in scanned documents, making them ready for review workflows.
OCR Scanned PDFs by Asking Claude
That folder of scans — old leases, signed contracts, photographed paperwork — becomes searchable conversationally: Claude checks the text layer, runs the OCR job through the Apdf MCP tools, and answers questions from the recovered text with page-level receipts.
Extract Text from Scanned Invoices for Automated Data Entry
Automate data entry from scanned invoices and receipts using Node.js and the Apdf OCR Read API. Extract vendor names, invoice numbers, and totals from image-based PDFs and feed them directly into your accounting system.
Your code made the PDF.
Then it went dark.
Opened, read, re-read, dropped on page 4 — you never see any of it. Share the PDFs you generate through Apdf recipient links, and every signal becomes something you can act on: ping Slack, update the CRM, let an agent follow up. Same account, same API token, one more call.
API · Webhook · MCP