PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

The node provides functionality to rotate PDF documents. It supports rotating an entire PDF file by specified angles such as 90 degrees clockwise, 90 degrees counter-clockwise, 180 degrees (upside down), or no rotation at all. This operation is useful in scenarios where PDFs are scanned or generated with incorrect orientation and need correction before further processing or distribution.

Practical examples include:

  • Automatically correcting the orientation of scanned invoices or contracts.
  • Preparing PDF documents for printing by rotating pages to the desired layout.
  • Adjusting PDFs received from external sources that have inconsistent page orientations.

Properties

Name Meaning
Input Data Type Choose how to provide the PDF file to rotate. Options:
• Binary Data - Use PDF file from previous node
• Base64 String - Provide PDF content as base64 encoded string
• URL - Provide URL to PDF file
Input Binary Field Name of the binary property containing the PDF file (usually "data" for file uploads). Required if Input Data Type is Binary Data.
Base64 PDF Content Base64 encoded PDF document content. Required if Input Data Type is Base64 String.
PDF URL URL to the PDF file to rotate. Required if Input Data Type is URL.
Document Name Name of the output PDF document after rotation. Defaults to "output.pdf".
Rotation Type Type of rotation to apply to the entire document. Options:
• No Rotation - Keep the document as is
• Clockwise - Rotate 90 degrees clockwise
• Counter Clockwise - Rotate 90 degrees counter-clockwise
• Upside Down - Rotate 180 degrees (upside down)
Output Binary Field Name Name of the binary property to store the output PDF file. Defaults to "data".
Advanced Options Custom JSON profiles to adjust extra properties for the API call. Useful for advanced users who want to specify additional parameters supported by the underlying PDF processing API.

Output

The node outputs a binary data field containing the rotated PDF document. The binary property name can be customized via the "Output Binary Field Name" property (default is "data"). The output JSON will typically contain metadata about the processed file along with the binary data representing the rotated PDF.

If the input was a PDF file, the output is the same PDF rotated according to the selected rotation type.

Dependencies

  • Requires access to an external PDF processing API service capable of rotating PDF documents.
  • Needs proper API authentication configured in n8n credentials (an API key or token).
  • Internet access may be required if providing the PDF via URL.

Troubleshooting

  • Common Issues:

    • Providing an invalid or inaccessible URL when using the URL input type will cause failures.
    • Incorrect base64 encoding of the PDF content may result in errors or corrupted output.
    • Specifying a non-existent binary property name when using binary data input will cause the node to fail.
    • Insufficient permissions or missing API credentials will prevent successful API calls.
  • Error Messages:

    • Errors related to "file not found" or "unable to fetch URL" indicate issues with the provided PDF URL.
    • "Invalid PDF format" or similar messages suggest the input PDF content is corrupted or improperly formatted.
    • Authentication errors indicate missing or invalid API credentials; ensure credentials are correctly set up in n8n.
  • Resolutions:

    • Verify URLs are accessible and correct.
    • Confirm base64 strings are properly encoded.
    • Double-check binary property names match those from previous nodes.
    • Ensure API credentials are valid and have necessary permissions.

Links and References

  • PDF4me API Documentation — For details on custom profiles and advanced options.
  • General information on PDF rotation and manipulation can be found in many PDF library documentations and online resources.

Discussion