PDF.co API icon

PDF.co API

Generate PDF, extract data from PDF, split PDF, merge PDF, convert PDF. Fill PDF forms, add text and images to pdf and much more with pdf.co!

Rotate PDF Pages

AI-generated

Overview

This node rotates pages of a PDF file accessible via a provided URL. It supports both automatic rotation based on text analysis and manual rotation by specifying an angle. Users can select specific pages or ranges to rotate and customize output options such as OCR language, output file name, callback URL, and link expiration time. This node is useful for correcting the orientation of scanned or digitally created PDFs in automated workflows.

Use Case Examples

  1. Automatically fix the rotation of scanned PDF pages using text analysis.
  2. Manually rotate specific pages of a PDF by 90°, 180°, or 270°.
  3. Set a custom output file name and receive the processed PDF via a webhook callback.

Properties

Name Meaning
Authentication Method to authenticate API requests, either via API Key or OAuth2.
PDF URL The URL of the PDF file to rotate.
Rotation Mode Choose between automatic rotation detection or manual angle specification.
Rotation Angle The angle to rotate the PDF pages when manual mode is selected.
Pages Specify which pages or page ranges to rotate, supporting ranges and negative indexing.
Advanced Options Additional optional settings such as OCR language, output file name, callback URL, link expiration, HTTP credentials for source URL, and custom JSON profiles for PDF processing.

Output

JSON

  • fileUrl - URL to the rotated PDF file output.
  • fileName - Name of the output PDF file.
  • pagesRotated - Details of the pages that were rotated.
  • rotationAngle - The angle by which the pages were rotated.

Dependencies

  • An API key or OAuth2 credentials for authentication with the PDF processing service.

Troubleshooting

  • Ensure the PDF URL is accessible and correct; errors may occur if the file cannot be fetched.
  • If using HTTP authentication for the source URL, verify the username and password are correct.
  • When using manual rotation, ensure the angle is one of the supported values (90, 180, 270).
  • If automatic rotation fails, check that the PDF contains recognizable text for analysis.
  • Errors related to authentication usually indicate invalid or missing API credentials; verify your API key or OAuth2 token.

Links

Discussion