PDF Tools

Manipulate PDF files with various operations

Overview

The "Rotate Pages" operation of the PDF Tools node allows users to rotate specific pages within a PDF document by a specified angle (90, 180, or 270 degrees). This is useful when scanned documents or PDFs have pages oriented incorrectly and need adjustment without altering the entire document.

Common scenarios include:

  • Correcting orientation of scanned pages that appear sideways or upside down.
  • Adjusting pages in multi-page PDFs where only some pages require rotation.
  • Preparing PDFs for printing or presentation with consistent page orientation.

Practical example:

  • A user receives a PDF report where pages 3 to 5 are rotated incorrectly. Using this node, they specify pages "3-5" and a rotation angle of 90 degrees to fix the orientation of those pages only.

Properties

Name Meaning
PDF Binary Field Name of the binary field containing the PDF file to be processed.
Pages Target pages to rotate, specified as a string (e.g., "1", "1,3-5", or "all").
Rotation Angle The angle in degrees to rotate the pages; valid values are 90, 180, or 270 degrees.

Output

The output is a binary PDF file with the specified pages rotated by the given angle. The output contains:

  • json: An empty JSON object {} indicating no additional metadata is returned.
  • binary: Contains one field (default name "output") holding the rotated PDF data encoded in base64, with MIME type application/pdf and filename output.pdf.

No textual or metadata extraction occurs in this operation; the output is purely the modified PDF binary.

Dependencies

  • Requires an input PDF file provided as binary data in the workflow.
  • Uses the pdf-lib library internally to manipulate PDF pages and apply rotations.
  • No external API keys or services are required.
  • The node expects the input binary data to have MIME type application/pdf.

Troubleshooting

  • Error: No binary data found for [field name]
    Occurs if the specified binary field does not exist or is empty in the input item. Ensure the correct binary field name is provided and that the input contains the PDF data.

  • Error: The file must be in PDF format (MIME type: application/pdf)
    Happens if the input binary data is not a valid PDF. Verify the input file is a proper PDF and the MIME type is correctly set.

  • Error: Invalid page numbers. Pages must be between 1 and [total pages]
    Indicates the specified pages to rotate are out of range. Check the page numbers or ranges provided in the "Pages" property.

  • Error: Pages to rotate are required
    The "Pages" property was left empty. Specify which pages to rotate, e.g., "all" or "1,3-5".

  • Rotation angle must be one of 90, 180, or 270
    If an unsupported rotation angle is provided, the operation may fail or behave unexpectedly. Use only these three angles.

Links and References

Discussion