PDFEditor
Overview
Section titled “Overview”The PdfEditor action edits a PDF in one or more steps, the operations. They run in the order listed, each on the result of the one before:
| Operation | What it does |
|---|---|
Merge |
Adds the pages of other PDFs at the end (or in front) |
RemovePages |
Deletes pages |
Rotate |
Rotates pages by 90°, 180° or 270° |
Reorder |
Puts the pages in a new order |
ExtractPages |
Writes selected pages into a new PDF |
Split |
Writes the PDF as several files, every n pages or before given pages |
ExtractText |
Reads the text of the pages, for the next actions |
FillForm |
Fills in form fields, optionally flattened |
ExtractForm |
Reads the values of all form fields |
Stamp |
Writes a text onto the pages: watermark, page numbers, received stamp … |
Overlay |
Lays another PDF onto the pages, e.g. a letterhead |
How the action handles files:
- The source stays as it is. The edited PDF is written as a new file (default:
<name>_edited.pdfnext to the source); onlyReplaceSourceoverwrites the source. Exception: if the source comes from a File trigger andOutputis empty, the file in the job folder is edited in place. It keeps the name from the trigger’sNewName, and the following actions get the edited PDF as{{FilePath}}. - The edited PDF is only written when an operation changes the PDF (
Merge,RemovePages,Rotate,Reorder,FillForm,Stamp,Overlay). An action that only reads (ExtractText,ExtractForm) or only writes new files (ExtractPages,Split) leaves the source alone and writes no edited PDF. - All or nothing. All files are first written under a temporary name (
name.part) and only get their names once every operation has succeeded. If one operation fails, the action stops there, writes nothing and fails. As with any action, the run then ends or the workflow’s error handling takes over. A file trigger watching the output folder never sees a half-written PDF. - Mistakes are errors, not silent skips: a page the PDF does not have, a missing file for
Merge, a form field name that does not exist, an unknownOp. The message says which operation failed and why, e.g.Operation 2 (RemovePages): Page 9 does not exist; the PDF has 5 page(s).
In the workflow editor you put the action together in a form and try it with Test step.
Structure
Section titled “Structure”{ "Type": "PdfEditor", "Name": "EditPdf", "Parameters": { "Source": "{{FilePath}}", "Output": "C:\\Out\\%filenamewithoutextension%_final.pdf", "Operations": [ { "Op": "RemovePages", "Pages": "last" }, { "Op": "Merge", "Files": "C:\\Templates\\terms.pdf" }, { "Op": "Stamp", "Text": "%page% / %pages%", "Position": "BottomCenter", "FontSize": 9 } ] }}| Parameter | Default | Meaning |
|---|---|---|
Source |
– | The PDF to edit, e.g. {{FilePath}} from a file trigger |
Output |
%filenamewithoutextension%_edited.pdf |
The edited PDF. A bare name goes next to the source; a full path anywhere. Must not be the source itself (that is ReplaceSource). Empty for a file from a File trigger: the file is edited in place and keeps its name. |
ReplaceSource |
false |
true: the edited PDF replaces the source; Output is ignored |
OutputFolder |
folder of the source | Where ExtractPages and Split write their files |
IfExists |
Overwrite |
A file to be written already exists: Overwrite or Error (the action fails before anything is changed) |
Operations |
– | The operations, in order (at least one) |
In Output, OutputFolder, FileName and Files, {{…}} placeholders, %filename%, %filenamewithoutextension% and %extension% (of the source) as well as %yyyy%, %MM%, %dd%, %HH%, %mm%, %ss% are replaced. Relative paths start in the folder of the source.
Pages, Order and SplitBefore take page lists. The numbers refer to the PDF as it is at that operation, i.e. after the operations before it.
| Notation | Pages |
|---|---|
3 |
page 3 |
1-3, 5, 8 |
pages 1 to 3; pages 5 and 8 (,, ; or spaces separate) |
8- |
page 8 to the last |
last, 2-last |
the last page; page 2 to the last |
odd, even, all |
odd, even, all pages |
5-1 |
5, 4, 3, 2, 1 (for Order and ExtractPages, which keep the order written) |
Where Pages is optional, empty means all pages.
Operations
Section titled “Operations”Each operation has Op and its own parameters.
Merge: adds PDFs.
| Parameter | Default | Meaning |
|---|---|---|
Files |
– | The PDF(s), separated by ;. A pattern such as C:\In\*.pdf adds all matches, sorted by name. A missing file, or a pattern matching nothing, is an error. |
AtStart |
false |
true: add in front of the first page instead of at the end |
Form fields of the added PDFs are kept.
RemovePages: Pages (required): the pages to remove. Removing every page is an error.
Rotate: Pages (empty = all) and Degrees: 90, 180, 270 or -90, clockwise, on top of the page’s current rotation (default 90).
Reorder: Order (required): the new order, e.g. 3, 1, 2. Pages not named follow behind in their current order; a page named twice is an error. "Order": "reverse" turns the whole PDF around.
ExtractPages: writes pages into a new PDF in OutputFolder; the edited PDF itself keeps them.
| Parameter | Default | Meaning |
|---|---|---|
Pages |
– | The pages, in the order written (required) |
FileName |
%filenamewithoutextension%_pages.pdf |
Name of the new PDF |
Split: writes the whole PDF as several files in OutputFolder.
| Parameter | Default | Meaning |
|---|---|---|
Every |
1 |
Pages per file: 1 = one file per page, 2 = two pages each, … |
SplitBefore |
– | Instead of Every: a new file starts at each of these pages, e.g. 4, 9 gives 1–3, 4–8, 9–end |
FileName |
%filenamewithoutextension%_%part%.pdf |
%part% = number of the part (01, 02, …), %from%/%to% = its first and last page. If two parts would get the same name, that is an error. |
ExtractText: Pages (empty = all). The text ends up in Response.Text, pages separated by a line break. Only real text is found; a scanned PDF without a text layer gives no text (there is no OCR).
FillForm: fills in AcroForm fields.
| Parameter | Default | Meaning |
|---|---|---|
Fields |
– | Field name → value, e.g. { "Name": "{{InitialData.Name}}", "Agree": true } |
Flatten |
false |
true: the values become part of the page; the PDF can no longer be filled in |
Text and list fields take the text. Check boxes take true/false (also yes/no, 1/0, x, on/off, ja/nein) or the box’s own state name; radio groups take the name of the option. A field name that is not in the PDF is an error; the message lists the fields the PDF has.
ExtractForm: reads all text, check box, radio and list fields into Response.Fields (name → value); unchecked boxes give Off. No parameters.
Stamp: writes a text onto the pages.
| Parameter | Default | Meaning |
|---|---|---|
Text |
– | The text (required). %page% and %pages% become the page number and the page count; dates with %dd%.%MM%.%yyyy%. Several lines with a line break (in JSON \n). |
Pages |
all | The pages to stamp |
Position |
Center |
TopLeft, TopCenter, TopRight, Center, BottomLeft, BottomCenter, BottomRight |
FontSize |
12 |
Size in pt (1–500) |
Bold |
false |
Bold |
Color |
#000000 |
Color as #RRGGBB, e.g. #C00000 for red |
Opacity |
100 |
Opacity in percent (0–100); 25 for a light watermark |
Rotation |
0 |
Degrees, counterclockwise, around the anchor point; 45 for a diagonal watermark |
Margin |
10 |
Distance from the page edge in mm (not for Center) |
The position refers to the page as it is shown: on a rotated page the stamp is upright. The text is set in Arial (embedded, so umlauts, €, Greek and Cyrillic work); without Arial on the PC, in Helvetica.
Overlay: lays another PDF onto the pages, e.g. a letterhead.
| Parameter | Default | Meaning |
|---|---|---|
OverlayFile |
– | The PDF that goes onto the pages (required), e.g. C:\Templates\letterhead.pdf. A relative path starts in the folder of the source. |
Pages |
all | The pages that get the overlay: empty = all, 1, 1,2, 1-10, 1,3,5-10 … (see Pages) |
OverlayPage |
1 |
Which page of the overlay PDF goes onto each page. 0 = page by page: the first page chosen gets overlay page 1, the second page 2 and so on; after the overlay’s last page, that page repeats. With a letterhead that has a first page and a follow-up page, the first page gets the letterhead and all others the follow-up page. |
InFront |
false |
false: behind the content (the usual letterhead, the text stays readable). true: over the content, e.g. for a logo, or when the page has a white background (such as a scan) that would otherwise hide the letterhead. |
Opacity |
100 |
Opacity of the overlay in percent (0–100) |
If the overlay has a different page size than the page, it is scaled to fit (keeping its proportions) and centered; pages of the same size (A4 on A4) are laid 1:1. Rotated pages are taken into account: the overlay sits the way the page is shown. Each overlay page is stored only once in the PDF, however many pages it is on. A missing or password-protected overlay PDF and an OverlayPage it does not have are errors.
{ "Op": "Overlay", "OverlayFile": "C:\\Templates\\letterhead.pdf", "Pages": "1" }Result
Section titled “Result”"Response": { "OutputPath": "C:\\Out\\RE-2026-0001_final.pdf", "PageCount": 5, "Files": [], "Results": [ { "Op": "RemovePages", "Status": "OK", "Message": "", "Pages": "5", "PageCount": 4 }, { "Op": "Merge", "Status": "OK", "Message": "", "Files": [ "C:\\Templates\\terms.pdf" ], "PagesAdded": 1 }, { "Op": "Stamp", "Status": "OK", "Message": "", "Pages": "1,2,3,4,5" } ], "SuccessCount": 3, "ErrorCount": 0}| Field | Content |
|---|---|
OutputPath |
The edited PDF (with ReplaceSource the source); empty if no operation changed the PDF |
PageCount |
Pages of the edited PDF (of the source if nothing was changed) |
Files |
Paths of the files from ExtractPages and Split |
Text |
Only with ExtractText: the text read |
Fields |
Only with ExtractForm: field name → value |
Results |
One entry per operation that ran, with Status OK or Error, the Message and details (pages, files, …). After an error the following operations do not run. |
The next actions read the result with {{EditPdf.Response.OutputPath}}, {{EditPdf.Response.Text}} or {{EditPdf.Response.Fields.FieldName}} (EditPdf = the action’s Name). Files works well with a Loop.
Form in the editor
Section titled “Form in the editor”In the diagram of the workflow editor the action has a form (in the settings panel and in the middle column of the test view):
- PDF: PDF file, Overwrite the source, Edited PDF (empty: a File trigger’s file is edited in place, otherwise
<name>_edited.pdfnext to the source), Folder for extracted files and what happens to an existing file. - Operations: run one after the other in the order shown. Choose the kind and Add; each operation can be removed and moved up or down. Each kind has its own fields: Merge (PDFs, Add in front), Remove pages, Rotate (pages and 90, 180, 270 or −90 degrees), Reorder, Extract pages (pages and file name), Split (Pages per file or Or split before pages, file name), Extract text, Fill form (table of fields, Flatten), Read form, Stamp text (text with
%page%and%pages%, pages, position, font size, color, opacity, rotation, distance from the edge, Bold) and Overlay PDF (file, Its page with 0 = page by page, pages, opacity, In front of the content).
Every field also takes {{…}} placeholders and values you drag in from the Input column of the test view; lists, switches and number fields become a text field when given a {{…}}. Parameters the form does not know are kept under Other parameters. Test step runs the action once, right away, with the data of the earlier steps, and shows the result with errors and warnings. The test really edits the PDF and writes the files; try it on a copy.
Example
Section titled “Example”Prepare incoming invoices. A file trigger picks up every PDF from the scanner folder. The action removes the empty last page, stamps the date received in red at the top right and puts the result into the archive folder. The text read is then available to the following actions (for example an If on the supplier name):
{ "Name": "Incoming invoices", "Autostart": true, "Trigger": { "Type": "File", "Name": "Scanner", "Parameters": { "Pool": "C:\\Scan\\Invoices", "Filter": "*.pdf" } }, "Actions": [ { "Type": "PdfEditor", "Name": "EditPdf", "Parameters": { "Source": "{{FilePath}}", "Output": "C:\\Archive\\%yyyy%\\%filenamewithoutextension%.pdf", "Operations": [ { "Op": "RemovePages", "Pages": "last" }, { "Op": "Stamp", "Text": "Received %dd%.%MM%.%yyyy%", "Pages": "1", "Position": "TopRight", "Bold": true, "Color": "#C00000" }, { "Op": "ExtractText", "Pages": "1" } ] } } ]}Split a collective PDF into single invoices of two pages each, into a folder of their own:
{ "Type": "PdfEditor", "Name": "SplitInvoices", "Parameters": { "Source": "C:\\Export\\invoices.pdf", "OutputFolder": "C:\\Export\\single", "Operations": [ { "Op": "Split", "Every": 2, "FileName": "invoice_%part%.pdf" } ] }}{{SplitInvoices.Response.Files}} then holds the paths of the new files.
