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 choose the rotation direction (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 correction or adjustment without altering the entire document. For example, scanned documents that have some pages upside down or sideways can be fixed automatically. Another use case is preparing PDFs for presentations or printing where certain pages require rotation.

Properties

Name Meaning
Input Data Type Method to provide the PDF file:
- 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") — used when Input Data Type is Binary Data
Base64 PDF Content Base64 encoded PDF document content — used when Input Data Type is Base64 String
PDF URL URL to the PDF file — used when Input Data Type is URL
Document Name Name of 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 to store the output PDF file (default: "data")
Advanced Options Custom JSON profiles for additional API options; refer to https://dev.pdf4me.com/apiv2/documentation/ for details

Output

The node outputs a binary PDF file with the specified pages rotated according to the chosen rotation type. The output is stored in a binary property named by the user (default "data"). The JSON output contains metadata about the processed item, but the main result is the binary PDF file ready for further processing or saving.

Dependencies

  • Requires access to the PDF4me API service to perform PDF manipulations.
  • Needs an API key credential configured in n8n to authenticate requests to the PDF4me API.
  • Internet access is required if using the URL input method to fetch the PDF file.

Troubleshooting

  • Common Issues:

    • Incorrect page number format may cause errors or unexpected behavior. Ensure page numbers are valid and formatted correctly (e.g., "1", "1,3,5", "2-4").
    • Providing an invalid or inaccessible URL will cause the node to fail fetching the PDF.
    • If the binary data field name does not match the actual binary property from the previous node, the node will not find the PDF file.
    • Insufficient API permissions or missing API key configuration will result in authentication errors.
  • Error Messages:

    • "Failed to fetch PDF from URL": Check the URL validity and network connectivity.
    • "Invalid page numbers": Verify the page numbers string format.
    • "Authentication failed": Confirm the API key credential is set up correctly.
    • "No PDF data found": Ensure the binary property name matches the input data.

Resolving these typically involves verifying input parameters, credentials, and network access.

Links and References

Discussion