Add Margin to PDF in n8n
Add Margin to PDF is a PDF4me node action in n8n that adds left, right, top, and bottom margins to a PDF, each measured in millimetres. Use it to create binding space for printed reports, leave room for annotations on handouts, or bring incoming documents up to a house layout standard automatically.
What this node does
PDF4me: Add Margin To PDF takes a PDF from Binary Data, a Base64 String, or a URL and returns a new file with the four margin values you specify applied in millimetres. Each side is set independently, so an asymmetric binding margin is just a larger left value. Because it runs as a workflow step, the same margin standard can be applied to every document that arrives without anyone opening a desktop editor.
Authenticating Your API Request
Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one that holds your PDF4me API key so the workflow can authenticate margin requests securely.
Important Facts You Should Not Miss

PDF4me Add Margin To PDF parameters panel in n8n
Automated Margins (n8n) vs a Desktop PDF Editor
Most results for this search are one-file-at-a-time editors. The difference is where the work happens.
| Approach | Trigger | Best fit |
|---|---|---|
| Desktop editor or online margin tool | A person opens and adjusts one file by hand | A single document you are already working on |
| PDF4me Add Margin To PDF in n8n | A generated report, an upload, or a scheduled batch | Applying one house margin standard to every document that arrives, unattended |
What Parameters Does Add Margin to PDF Need?
Required: Action, Input Data Type, the field matching that input type, Output File Name, Document Name, and all four margin values. Binary Data Output Name and Custom Profiles carry working defaults.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| Action | Required | Selects the PDF4me node action to run. Choose Add Margin To PDF. | Add Margin To PDF |
| Input Data Type | Required | Format of the source PDF input. Choose Binary Data (from a previous node), Base64 String, or URL. | Binary Data |
| Input Binary Field | Conditional | Name of the binary property on the incoming n8n item that holds the PDF. Required when Input Data Type is Binary Data. Defaults to data. | data |
| Base64 Document Content | Conditional | Base64-encoded content of the source PDF. Required when Input Data Type is Base64 String. | JVBERi0xLjQK... |
| File URL | Conditional | Publicly reachable HTTPS URL to the source PDF. Required when Input Data Type is URL. | https://example.com/report.pdf |
| Output File Name | Required | Filename for the PDF returned with margins applied. Include the .pdf extension. | document_with_margins.pdf |
| Document Name | Required | Filename of the source PDF, used for reference and tracking on the request. | document.pdf |
| Left Margin (Mm) | Required | Left margin width in millimetres. Set this larger than the other sides when you need binding space. | 20 |
| Right Margin (Mm) | Required | Right margin width in millimetres. | 20 |
| Top Margin (Mm) | Required | Top margin height in millimetres. Increase it when a printed header or letterhead needs clearance. | 25 |
| Bottom Margin (Mm) | Required | Bottom margin height in millimetres. Increase it when a footer or page number needs clearance. | 25 |
| Binary Data Output Name | Optional | Name of the binary property the output item exposes. Defaults to data. | data |
| Custom Profiles | Optional | Advanced Options field for extra processing settings, supplied in a JSON-like format. Leave blank unless you have a specific profile to apply. | { "preserveContentQuality": true } |
Output Fields
A successful run returns one n8n item carrying the PDF with margins applied.
| Field | Type | What it contains |
|---|---|---|
Binary (data) | Binary | The PDF with the four margin values applied, under Binary Data Output Name (default data). |
fileName | String | Generated filename, matching Output File Name. |
mimeType | String | MIME type of the output, always application/pdf. |
fileSize | Number | Size of the returned PDF in bytes. |
pageCount | Number | Number of pages processed with margin adjustments. |
success | Boolean | True when the margin operation completed, false on failure. Use it to branch error handling. |
message | String | Human-readable status message, carrying success confirmation or error detail. |
How Do I Set Up Add Margin to PDF in n8n?
- Add PDF4me to your n8n workflow and choose the Add Margin To PDF action.
- In Credential to connect with, select your PDF4me credential or click Create New Credential and paste your API key.
- Set Input Data Type to Binary Data (default), Base64 String, or URL and supply the matching source PDF field.
- Enter Left Margin (Mm), Right Margin (Mm), Top Margin (Mm), and Bottom Margin (Mm) in millimetres.
- Set Output File Name (must end in
.pdf) and Document Name for the source file. - Execute the node and route the returned PDF into the next step, such as storage, email, or a print queue.
Typical Setups
Workflow ExamplesCommon n8n workflow patterns using Add Margin to PDF.
- A scheduled report is generated as a PDF overnight.
- Add Margin to PDF applies a wide left margin and narrower right, top, and bottom values.
- The result goes to the print queue with room for spiral or comb binding.
- Training material is uploaded to a shared folder.
- Add Margin to PDF widens the right margin so readers have space for notes.
- The annotated-ready copy is distributed to attendees.
- A webhook receives PDFs from an external supplier with inconsistent layouts.
- Add Margin to PDF applies the same four values to every file.
- Documents enter the archive with a uniform page presentation.
- A merged document is assembled from several sources.
- Add Margin to PDF creates bottom clearance first.
- Add Page Number to PDF then places numbering inside the new footer space.
Practical Tips
Cheat Sheet
| Field | Value |
|---|---|
| Action | Add Margin To PDF |
| Input Data Type | Binary Data |
| Input Binary Field | data |
| Output File Name | document_with_margins.pdf |
| Document Name | document.pdf |
| Left / Right Margin (Mm) | 20 / 20 |
| Top / Bottom Margin (Mm) | 25 / 25 |
| Binary Data Output Name | data |
| Credentials | PDF4me API credential |