Actions80
- Extract Text From Word
- Find And Replace Text
- Convert PDF To Editable PDF Using OCR
- Create Swiss QR Bill
- Split PDF By Barcode
- Split PDF By Swiss QR
- Split PDF By Text
- Split PDF Regular
- Create PDF/A
- Convert HTML To PDF
- Convert Markdown To PDF
- Upload File To PDF4me
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Fill PDF Form
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- AI-Invoice Parser
- AI-Process HealthCard
- AI-Process Contract
- Generate Barcode
- Classify Document
- Parse Document
- Linearize PDF
- Flatten PDF
- Convert To PDF
- Json To Excel
- Convert PDF To Excel
- Convert PDF To Word
- Convert PDF To PowerPoint
- Convert VISIO
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Extract Pages
- Merge Multiple PDFs
- Overlay PDFs
- Rotate Document
- Rotate Page
- Sign PDF
- URL to PDF
- Add Image Watermark To Image
- Add Text Watermark To Image
- Compress Image
- Convert Image Format
- Create Images From PDF
- Flip Image
- Get Image Metadata
- Image Extract Text
- Remove EXIF Tags From Image
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Image
- Rotate Image By EXIF Data
- Compress PDF
- Get PDF Metadata
- Repair PDF Document
- Get Document From Pdf4me
- Update Hyperlinks Annotation
- Protect Document
- Unlock PDF
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Generate Document Single
- Generate Documents Multiple
- Get Tracking Changes In Word
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Attachment From PDF
- Extract Text By Expression
- Extract Table From PDF
- Extract Resources
Overview
This node operation "Add Margin To PDF" allows users to add custom margins around an existing PDF document. It is useful when you want to increase the whitespace around the content of a PDF, for example, to prepare documents for printing with specific margin requirements or to create space for annotations.
Typical use cases include:
- Adding consistent margins to PDFs generated from other sources.
- Preparing PDFs for binding or physical filing where extra margin space is needed.
- Adjusting layout for better readability or compliance with formatting standards.
Users can provide the source PDF in multiple ways: as binary data from a previous node, as a base64 encoded string, or via a URL pointing to the PDF file.
Properties
| Name | Meaning |
|---|---|
| Input Data Type | Choose how to provide the PDF file to add margins to. Options: Binary Data (from previous node), Base64 String (encoded PDF content), URL (link to PDF file). |
| Input Binary Field | Name of the binary property containing the PDF file (used only if Input Data Type is Binary Data). |
| Base64 PDF Content | Base64 encoded string representing the PDF document content (used only if Input Data Type is Base64 String). |
| PDF URL | URL to the PDF file to add margins to (used only if Input Data Type is URL). |
| Output File Name | Desired filename for the output PDF file with added margins. Defaults to "document_with_margins.pdf". |
| Document Name | Name of the source PDF file for reference purposes. Defaults to "document.pdf". |
| Left Margin (Mm) | Size of the left margin to add, in millimeters. Accepts values from 0 to 100. Default is 20 mm. |
| Right Margin (Mm) | Size of the right margin to add, in millimeters. Accepts values from 0 to 100. Default is 20 mm. |
| Top Margin (Mm) | Size of the top margin to add, in millimeters. Accepts values from 0 to 100. Default is 25 mm. |
| Bottom Margin (Mm) | Size of the bottom margin to add, in millimeters. Accepts values from 0 to 100. Default is 25 mm. |
| Advanced Options | Optional JSON string to specify custom profiles and additional API options for advanced margin adjustments. Users can refer to external API documentation for supported profile settings. |
Output
The node outputs the modified PDF file with the specified margins added. The output is provided as binary data suitable for further processing or saving.
The main output field is:
json: Contains metadata about the processed file.binary: Contains the actual PDF file data with the new margins applied, accessible under the configured binary property name.
Dependencies
- Requires access to an external PDF processing API service that supports adding margins to PDF files.
- Needs proper API authentication credentials configured in n8n to communicate with the PDF processing service.
- Internet access is required if the input PDF is provided via URL.
Troubleshooting
Common Issues:
- Providing an invalid or inaccessible URL will cause the node to fail fetching the PDF.
- Incorrect base64 encoding or corrupted binary data may result in processing errors.
- Specifying margin values outside the allowed range (0-100 mm) might cause validation errors.
- Missing or incorrect API credentials will prevent successful communication with the PDF processing service.
Error Messages:
- "Failed to fetch PDF from URL": Check the URL accessibility and correctness.
- "Invalid PDF content": Verify the input data format and integrity.
- "Margin value out of range": Ensure margin values are between 0 and 100 mm.
- "Authentication failed": Confirm API credentials are correctly set up in n8n.
Links and References
- PDF4me API Documentation — For details on custom profiles and advanced options.
- Base64 Encoding Guide — Understanding base64 encoded data.
- n8n Documentation — General information on configuring nodes and credentials.