Batch jobs and the automation port
AntiPDF can run the same work over many files at once: make scans searchable, make files smaller, remove sensitive details, archive them as PDF/A, and more. The steps are kept as a recipe that you can save, share and run again, from the Batch window, from a terminal, or from your own scripts through the automation port.
The originals are never changed. Every result is a new file.
1. The Batch window
Open it with File › Batch… (Ctrl+Shift+B). It has three parts, in the order of the work.
Files. Drop files or whole folders from Explorer onto the window, or use Add files and Add a folder. A folder brings the documents in it and in its folders. Up and Down choose a row, Delete takes it out of the list (nothing on disk changes).
Recipe. The steps run from top to bottom. Add a step lists them; click a step to see its options. The arrows move a step, the cross takes it out. Your saved recipes are listed at the top: click one to use it. The buttons beside the name save the recipe, start a new one, export it as a file, import a file, and delete it.
Results go. Beside each original, or in a folder you choose (with Keep the subfolders to repeat the folders you added). Something is added to each name, " (processed)" unless you change it. When a name is taken: Keep both adds a number, Skip the file leaves it, Replace it writes over the old result. An original is never replaced. Write a log puts a text file beside the results with each file and what became of it.
Try it goes through the files and says what would happen, writing nothing: which files would be written and under which name, which would be skipped and why. Start runs the recipe. The batch goes on if you close the window; open it again to see it. Stop ends it after the steps in progress; files not started are left as they are.
Each file ends in one of three ways:
- Done, with the files written and notes (for example "62% smaller", "3 scanned pages read", "1 page made a picture: check it").
- Skipped, with the reason (protected with a password, not a PDF, a result with that name is already there).
- Failed, with a plain message (damaged, an encryption AntiPDF cannot read, a font PDF/A needs that is not embedded).
A password-protected file is skipped: open it in AntiPDF, save a copy without the password, and add that copy. A damaged file that can still be read is worked on and its result says "check the result".
2. The steps
| Step | What it does |
|---|---|
| Convert to PDF | Word, OpenDocument, ebooks, pictures and text files become PDFs. Only as the first step. Without it, other kinds of files are skipped. |
| Make searchable | Scanned pages are read on this computer and get an invisible text layer. |
| Remove sensitive details (Pro) | Card numbers, IBANs, ID numbers, e-mail addresses, phone numbers and your redaction lists. Pages with a match become pictures with the details painted over. The copy is read back and checked before it is written. |
| Compress PDF | Makes the file smaller: pictures scaled down to the resolution you choose, photographs stored as JPEG. |
| Watermark (Pro) | Text across the pages or along an edge; {name}, {date}, {file}, {page} and {pages} are filled in. |
| Archive as PDF/A | An archival copy at PDF/A-2b (the usual choice), PDF/A-1b (for places that ask for the oldest level; no transparency) or PDF/A-3b (attached files kept). Fonts that are not embedded are embedded from this computer's fonts when it has them; scripts are left out, and attachments too except at PDF/A-3b. Each copy is validated when it is made, and the log says what could not be fixed. |
| Keep some pages | Only the pages you name, such as 1-3, 7, 10- (from 10 to the end). |
| Rotate pages | A quarter, half or three quarters, clockwise, on all or some pages. |
| Flatten form fields | Filled fields become part of the page. |
| Remove hidden data (Pro) | What you choose of: properties and metadata, scripts and actions, attached files, page thumbnails, private application data, comments and markup, and what is in layers switched off (metadata, scripts and attachments unless you choose). Earlier versions kept inside each file go too. Check the copies before you share them. |
| Sign with your certificate (Pro) | An invisible signature with the certificate chosen in Security › Sign. Only as the last step. |
| Join into one file | All files become one PDF, in the order of the list. |
| Preflight | Checks each file against a profile: Will open anywhere, Print shop, PDF/X-1a, PDF/X-4, a PDF/A level, or a profile of your own made in Tools › Preflight. The log says what was found. With "Fix automatically" the result has the fixes (fonts embedded from this computer's, pictures scaled down, RGB made CMYK, trim boxes, the file written whole) and is checked again; with "Is marked failed" a file with findings fails. A PDF/A profile only checks: add Archive as PDF/A to make PDF/A copies. |
| Number pages (Bates) | A running number such as ACME-000123 on every page: prefix, first number, digits, suffix, where on the page, distance from the edges, font, weight, size and colour. The numbers go on from file to file in the order of the list (move a file with its up and down arrows), so the files are worked on one at a time. The numbers are text in an embedded font, so they can be searched and PDF/A still works. A list of which file got which numbers is written beside the results (AntiPDF page numbers DATE.csv) and in the log. Not before Remove sensitive details, which could find the numbers and paint them over. |
| Split into parts | Every few pages, or one part per page range. |
| Tables to a spreadsheet | The tables found on the pages (from their ruling lines and from text set in columns) as an Excel workbook with a sheet each, as CSV or as Markdown. Joined cells stay joined in Excel, the header row is bold and numbers are numbers. Only as the last step; a file with no tables is skipped. In one document, Tools › Inspect › Extract shows the tables first so you can correct them. |
| Keep the pages that hold | Only the pages with the words you give (any of them, or every one; whole words or not), or, in the recipe's text, the pages where a form field holds a value. A file with no page that matches is skipped. |
| Take out pictures, fonts and files | Every picture (JPEG and JPEG 2000 as stored, others as PNG), every embedded font program and every attached file, as files named after the document, with a report of what each file is. Only as the last step. Check a font's licence before you use it elsewhere, and open attached files only if you trust the document. |
| Set the properties | The title, author, subject and keywords, in the properties and the XMP metadata (the rest of the XMP is kept). An empty field empties that property. |
| Bookmarks from the headings | Bookmarks made from the headings (the tags of a tagged document, else the sizes of its text), and, if you like, a contents page in front with each heading linked to its page. A file with no headings is skipped. |
| Repair | Each file read again from its first byte and written with a sound cross-reference table; the log says what was found (objects that could not be read, damaged streams). Check repaired copies before you rely on them. |
| Accessibility (PDF/UA) | Check: each file against PDF/UA-1 or PDF/UA-2; the log says whether it passes, its first failures and how many things a person should look at; with "Is marked failed" a file that does not pass fails. Tag: a first draft of the tags from the page layout (headings, paragraphs, lists, tables, pictures; running heads and page numbers as artifacts), in the language and with the title you give; tags already in a file are replaced, and the log says what is left to do by hand (pictures' alternate text above all). Fix automatically: the tab order, the title shown and links described; with "Mark it as PDF/UA" the file says it is PDF/UA when nothing else is left. Check the reading order and every picture's alternate text yourself before you publish a file as accessible. |
| Export as text / Markdown | A .txt or .md file instead of a PDF. Only as the last step. |
Always check redacted copies before you send them. Open each one and look at every page that was made a picture. Scanned pages are read by OCR first; a page whose text could not be read is named in the result, so you can check it yourself.
3. Three examples
Scanned invoices, every month. The accounts folder fills with scans from the office copier. A recipe "Invoices in" with *Make searchable* and *Compress PDF* (150 dots per inch) turns a month of scans into searchable files a third of the size. Drop the month's folder on the Batch window, choose a results folder with *Keep the subfolders*, and Start.
Sending a client's file to a third party. Before a case folder leaves the office, a recipe with *Remove sensitive details* (card numbers, IBANs, ID numbers, and the list "Client names") and *Remove hidden data* makes a clean copy of every document in a new folder. Try it first to see the file list, then Start, then open each copy and check every redacted page.
Archiving a finished project. *Convert to PDF* (for the Word and OpenDocument files), *Make searchable* and *Archive as PDF/A* turn a project folder into one archival set. A file whose font is neither embedded nor installed on this computer fails with the font named: install the font, or open the file where it was made and save it with its fonts embedded, and run the batch again on those. The log says, for each copy, whether it passes the PDF/A validator; check any copy it lists with Tools › Preflight.
Numbering a production for court. A case's documents go to the other side numbered from NORTHWIND-000001. Open one of them and choose Tools › Number pages, set the prefix and the first number, look at the preview, then Number several files. Drop the documents on the Batch window, put them in the order to be numbered with the arrows, Try it to see each file's range, then Start. Keep the list of numbers (the .csv) with the production. To number one document at a time instead, save each from Tools › Number pages: the first number moves on past the last one used.
4. Recipes as files
Export writes the recipe as a small text file (JSON). Send it to a colleague, keep it with the project, or run it from a terminal. Import reads one back. A recipe file looks like this:
{"antipdf": "recipe", "version": 1, "name": "Invoices in",
"steps": [{"do": "ocr"}, {"do": "compress", "max_dpi": 150, "quality": 75}]}
The steps and their options are listed in the API reference (automation-api.md). An option AntiPDF does not know is refused with its name, so a typing mistake never runs a different job.
5. From a terminal
antipdf --batch "Invoices in.json" D:\Scans\2026-10 --out D:\Invoices\2026-10
antipdf --batch "Invoices in" D:\Scans\2026-10 (a saved recipe, by name)
antipdf --job job.json (a job file, as the port takes it)
Options of --batch: --out <folder>, --suffix <text>, --exists number|skip|replace, --keep-folders, --dry-run, --workers <n>, --no-log. For a Sign step the certificate's password is taken from the AA_CERT_PASSWORD variable.
Each file is printed with its outcome. The exit code is 0 when every file was done or skipped, 1 when one failed or was stopped, and 2 when the job could not start (a recipe that cannot run, no files, a Pro step without Pro).
No window opens. Removing sensitive details draws pages on the graphics card (Vulkan 1.2, no window or screen needed); Make searchable uses the graphics card when there is one and the processor otherwise; every other step uses neither.
On Windows the command is the program itself: with the version from antisoftworks.com, %LOCALAPPDATA%\Programs\AntiPDF\antipdf.exe. Command Prompt and PowerShell do not wait for a windowed program: use start /wait antipdf.exe --batch ... in Command Prompt, or Start-Process -Wait -NoNewWindow antipdf.exe -ArgumentList ... in PowerShell. The Microsoft Store version has no command name yet.
6. The automation port
Scripts on your computer can send jobs to AntiPDF over HTTP. It is off until you turn it on in Preferences › Automation.
- Let scripts send jobs turns it on. The first time, a token is made. Every request must carry it; show it with the eye, copy it, or make a new one (the old one stops working at once). Keep it as you would a password.
- Port: 7431 unless you choose another.
- Folders jobs may use: a job's files and results must be inside these folders, links and junctions followed. Until one is added, every job is refused. Any folder lifts this rule: only turn it on when your scripts need it.
- Request log: one line per request (time, route, answer); never a file name, a path or what was sent.
The port listens on 127.0.0.1 only: nothing on another computer can reach it, and web pages in a browser are refused. Jobs run in a worker process, two at a time, sixteen more waiting. antipdf --serve runs the port without the window, as set in Preferences.
A first job from PowerShell:
$h = @{ Authorization = "Bearer <the token>" }
$job = @{ recipe = "Invoices in"; inputs = @("D:\Scans\2026-10");
output = @{ folder = "D:\Invoices\2026-10" } } | ConvertTo-Json -Depth 4
$r = Invoke-RestMethod -Method Post -Uri http://127.0.0.1:7431/v1/jobs -Headers $h -ContentType application/json -Body $job
Invoke-RestMethod -Uri "http://127.0.0.1:7431/v1/jobs/$($r.id)" -Headers $h
And with curl:
curl -H "Authorization: Bearer <the token>" -H "Content-Type: application/json" \
-d '{"steps": [{"do": "ocr"}, {"do": "text"}], "inputs": ["D:\\Scans\\a.pdf"]}' \
http://127.0.0.1:7431/v1/jobs
The routes, the job's text and every answer are in automation-api.md.