0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

PDF → Rotate PDF Pages

AI-generated

Overview

The node provides a utility to rotate pages within a PDF document. It supports rotating all or selected pages by specified angles (90°, 180°, or 270° clockwise). This is useful in scenarios where scanned PDFs or documents have pages oriented incorrectly and need adjustment without manual editing.

Practical examples:

  • Rotating scanned documents that were scanned sideways.
  • Adjusting orientation of specific pages in a multi-page PDF before sharing or archiving.
  • Automating batch rotation of PDFs received from external sources.

Properties

Name Meaning
PDF URL Public URL of the PDF file to be rotated.
PDF Buffer Binary buffer data of the PDF file, allowing direct upload instead of URL.
Rotation Angle Angle to rotate the pages. Options: 90° Clockwise, 180°, 270° Clockwise (90° Counter-Clockwise).
Pages to Rotate Specifies which pages to rotate. Supports ranges like "1,3-5,^3-^1" where 1 is first page, ^1 last. Leave empty to rotate all pages.
File Name Desired name for the output PDF file after rotation.
Return as URL Boolean flag indicating whether to return the rotated PDF as a downloadable URL or as binary data.

Output

The node outputs the rotated PDF either as:

  • A downloadable URL if "Return as URL" is set to true.
  • Binary data representing the rotated PDF file otherwise.

The JSON output will contain the resulting PDF content or a link to download it, depending on the configuration.

Dependencies

  • Requires an API key credential for authentication with the external 0CodeKit service.
  • The node sends a POST request to the endpoint /pdf/pages/rotate on the 0CodeKit API.
  • The input PDF can be provided via a public URL or as binary buffer data.
  • No additional environment variables are explicitly required beyond the API key.

Troubleshooting

  • Invalid PDF input: If the PDF URL is inaccessible or the buffer is invalid, the node may fail. Ensure the URL is publicly accessible or the buffer contains valid PDF data.
  • Incorrect page range syntax: Using an invalid format for the "Pages to Rotate" property may cause errors. Use correct page numbering and range syntax as described.
  • API authentication errors: Missing or incorrect API key will result in authorization failures. Verify the API key credential is configured properly.
  • Large files or timeouts: Very large PDFs might cause timeouts or slow responses. Consider splitting large documents or increasing timeout settings if possible.

Links and References

  • 0CodeKit API Documentation (base URL used by the node)
  • PDF page numbering conventions: first page = 1, last page = ^1 (caret notation)

Discussion