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

This node operation "Rotate PDF Page" allows users to rotate specific pages within a PDF document. It supports various input methods for the PDF file, including binary data from a previous node, a base64 encoded string, or a URL pointing to the PDF file. Users can specify which pages to rotate and select the rotation type (e.g., 90 degrees clockwise, counter-clockwise, upside down, or no rotation). The output is a new PDF document with the specified pages rotated accordingly.

This node is beneficial in scenarios where PDFs need page orientation adjustments without altering the entire document. For example:

  • Correcting scanned documents where some pages are sideways.
  • Rotating pages before merging or printing.
  • Preparing PDFs for presentations or reviews requiring consistent page orientation.

Properties

Name Meaning
Input Data Type Method to provide the PDF file:
- Binary Data: Use PDF from previous node's binary property.
- Base64 String: Provide PDF content as a base64 encoded string.
- URL: Provide a direct URL to the PDF file.
Input Binary Field Name of the binary property containing the PDF file when using Binary Data input type (usually "data").
Base64 PDF Content Base64 encoded string of the PDF document content (used if Input Data Type is Base64 String).
PDF URL URL to the PDF file (used if Input Data Type is URL).
Document Name Desired name for the output PDF document (default: "output.pdf").
Rotation Type Type of rotation to apply to the specified pages:
- No Rotation: Keep pages as is.
- Clockwise: Rotate 90 degrees clockwise.
- Counter Clockwise: Rotate 90 degrees counter-clockwise.
- Upside Down: Rotate 180 degrees.
Page Numbers Pages to rotate, specified as a string (e.g., "1", "1,3,5", or "2-4").
Output Binary Field Name Name of the binary property where the output PDF file will be stored (default: "data").
Advanced Options Optional JSON string to set custom profiles or extra API options for advanced use cases.

Output

The node outputs a binary property containing the rotated PDF document. The binary data represents the updated PDF file with the specified pages rotated according to the selected rotation type. The output also includes a JSON object with metadata about the operation result.

  • json: Contains metadata or status information related to the rotation operation.
  • binary: Contains the actual PDF file data under the specified output binary field name (default "data").

Dependencies

  • Requires access to an external PDF processing API service that performs the rotation operation.
  • Needs proper API authentication configured in n8n credentials (an API key or token).
  • Internet access may be required if the PDF is provided via URL or if the API is cloud-based.

Troubleshooting

  • Common Issues:

    • Invalid page numbers format or specifying pages outside the document range may cause errors.
    • Providing incorrect input data type or missing required fields (e.g., binary property name or base64 content) will prevent execution.
    • Network issues or invalid URLs when using URL input type can lead to failures fetching the PDF.
    • API authentication errors if credentials are not properly set up.
  • Error Messages:

    • "Invalid page numbers": Check the page number string format and ensure pages exist in the PDF.
    • "Missing input PDF data": Verify that the input data is correctly provided based on the selected input type.
    • "Failed to fetch PDF from URL": Confirm the URL is accessible and points to a valid PDF.
    • "Authentication failed": Ensure API credentials are correctly configured in n8n.

Links and References

Discussion