Actions108
- AI Actions
- Transcribe
- Detect Brand
- Extract Contact Information
- Mood Detection
- Detect Adult Content
- Enitity Detection
- Language Detection
- Too Long To Read
- Check Content Policy
- Detect Faces
- Generate Python Code
- Picture Text Recognition
- Detect Color
- Generate Image
- PDF OCR
- Translation
- Detect Email Type
- Generate Javascript Code
- Picture Object Recognition
- Business Actions
- Calculate Actions
- Code Actions
- Convert Actions
- Crypto Actions
- Date & Time Actions
- Generate Actions
- Image Actions
- Operator Actions
- PDF Actions
- Storage Actions
- Text Actions
- User Actions
Overview
The node provides a set of PDF manipulation utilities under the "PDF" resource, specifically supporting an operation called "PDF Pages." This operation allows users to modify pages within a PDF file in various ways such as adding new pages, rotating existing pages, removing pages, or resizing pages.
This node is beneficial in scenarios where automated PDF editing is required without manual intervention. For example:
- Adding blank pages or custom-sized pages to an existing PDF.
- Rotating specific pages to correct orientation issues.
- Removing unwanted pages from a PDF document.
- Resizing pages to fit specific dimensions for printing or display.
Practical examples include preparing reports by inserting cover pages, correcting scanned documents with rotated pages, or trimming PDFs by removing unnecessary pages.
Properties
| Name | Meaning |
|---|---|
| Code Variables | A collection of code variables defined in the code editor that can be used dynamically in the node. Each variable has a name/ID and a value. |
| PDF Pages | The page operation to perform. Options: Add, Rotate, Remove, Resize. |
| URL | Public URL of the PDF file to manipulate. |
| Buffer | PDF content provided as a buffer string instead of a URL. |
| Get File as URL | Boolean indicating whether the output PDF should be returned as a public URL. |
| Filename | Desired filename for the resulting PDF file. |
| Pages (Add) | Page indices where additional pages should be added (multiple values allowed). |
| Pages (Remove/Resize/Rotate) | Pages to manipulate specified as ranges or individual pages, e.g., "1", "3-5", "^3-^1". Required for these operations. |
| Width of Page | Width in points for added or resized pages. |
| Height of Page | Height in points for added or resized pages. |
| Rotation of Page | Degree of rotation to apply to pages (required for rotate operation). |
Output
The node outputs JSON data representing the result of the PDF pages operation. The exact structure depends on the operation performed but generally includes information about the modified PDF file.
If the "Get File as URL" property is true, the output will contain a URL pointing to the processed PDF file. Otherwise, it may return the PDF content as a buffer or base64 encoded string.
Binary data handling is implied for PDF buffers, allowing seamless integration with other nodes expecting binary files.
Dependencies
- Requires an API key credential for authentication with the external service providing PDF manipulation capabilities.
- The node relies on an external API endpoint to perform PDF operations; thus, internet connectivity and valid credentials are necessary.
- No additional environment variables are explicitly required beyond the API key credential.
Troubleshooting
Common Issues:
- Invalid page range syntax in the "Pages" property can cause errors. Ensure ranges are correctly formatted (e.g., "1,3-5,^3-^1").
- Providing both URL and buffer inputs simultaneously might lead to conflicts; use only one source of PDF input.
- Missing required properties for certain operations (e.g., rotation angle for rotate) will cause execution failures.
Error Messages:
- Errors related to authentication usually indicate missing or invalid API credentials.
- "Page index out of bounds" errors occur if specified pages do not exist in the source PDF.
- Malformed PDF input errors suggest the provided URL or buffer does not point to a valid PDF file.
Resolutions:
- Double-check all input parameters for correctness and completeness.
- Verify API credentials and network access.
- Validate the PDF source before processing.
Links and References
- n8n Expressions Documentation — for using expressions in variable names.
- General PDF manipulation concepts: https://en.wikipedia.org/wiki/PDF
- Points unit reference for PDF page sizes: https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/pdf_reference_archives/PDFReference.pdf (see page size units)
This summary focuses exclusively on the "PDF Pages" operation of the "PDF" resource as requested, based on static analysis of the provided source code and property definitions.