Skip to main content

Split PDF by barcode using Zapier: separate a scanned batch into one file per document with PDF4me

21 min read
PDF4me Team

Split by Barcode is a PDF4me action for Zapier that cuts one scanned batch into separate PDFs wherever a barcode appears. A six step Zap watches Dropbox, filters for PDFs, splits on a QR code, loops over the resulting documents, and saves each one with its own name and log line.

Scan twenty invoices in one pass and you get one PDF with eighty pages. Splitting it by page number only works if every invoice is the same length, and they never are. A barcode separator sheet solves that: the split happens wherever the barcode is, whatever the page count. These screenshots come from a Zap that ran on 03 November 2026.

The flow at a glance
1. New File in Folder
Dropbox trigger watching /SplitBarcodeAP/Input.
2. Filter conditions
Filter by Zapier stops anything that is not a PDF.
3. Split by Barcode
PDF4me cuts the batch wherever the QR code appears.
4. Create Loop From Line Items
Looping by Zapier iterates the documents that came back.
5. Upload File
Dropbox saves each split document to /SplitBarcodeAP/Output.
6. Create or Append to Text File
Dropbox appends one log line per document.
The short version

Put a separator page carrying a QR code in front of every document, scan the whole stack as one PDF, and drop it in Dropbox. PDF4me splits the batch at each barcode, Looping by Zapier walks the resulting list, and every document is saved individually as AP-Batch-Scan-Nov-01_1.pdf, _2.pdf and so on, each with a line in a log file.

Why-Based Q&A​

Why split on a barcode rather than a page count? Page counts vary. One invoice is two pages, the next is five. A barcode separator marks the boundary explicitly, so the split is correct whatever the lengths are. It is the only method that survives a mixed batch.

Why is a loop needed at all? Split by Barcode returns a list of documents, not one file. Without a loop, the Zap would only handle the first item. Looping by Zapier turns that list into one pass per document, so step 5 runs as many times as there were barcodes.

Why "Before the barcode" for the split page? The separator sheet belongs to the document that follows it, not the one before. Splitting before the barcode starts each new file at its own separator. Choosing After would attach every separator to the previous document.

Why 150 for PDF Render Dpi? The action rasterises pages to find barcodes. Too low and a dense code is unreadable, too high and the step is slow for a long batch. 150 reads a standard QR separator reliably without making a eighty page scan crawl.


What You'll Get​

Input: one scanned PDF containing several documents, each preceded by a page carrying a QR code. Output: one PDF per document in /SplitBarcodeAP/Output, numbered from the batch name, plus one line per document in /SplitBarcodeAP/Log/split-barcode-log.txt.


What You Need​

  • Zapier. Open the PDF4me Zapier app. Six steps plus Looping, so a paid Zapier plan is required.
  • PDF4me API key. Get your API key. Connect it the first time you add a PDF4me action.
  • Dropbox with /SplitBarcodeAP/Input, /SplitBarcodeAP/Output and /SplitBarcodeAP/Log.
  • Separator pages carrying a QR code whose text starts with a known string. This build uses PDF4me Barcode.

Grab the samples first. The input is a batch with two documents separated by a QR page. The two outputs are what the Zap produced from it.


The Flow at a Glance​

  1. New File in Folder (Dropbox trigger, polls every 2 minutes).
  2. Filter conditions (Filter by Zapier) continues only for PDFs.
  3. Split by Barcode (PDF4me) cuts the batch at each QR code.
  4. Create Loop From Line Items (Looping by Zapier) iterates the results.
  5. Upload File (Dropbox) saves each document.
  6. Create or Append to Text File (Dropbox) logs each document.

Complete flow overview​

Zapier run history showing a successful six step Zap: Dropbox New File in Folder, Filter by Zapier, PDF4me Split by Barcode, Looping by Zapier Create Loop From Line Items, Dropbox Upload File, and Dropbox Create or Append to Text File

A successful run on 03 November 2026. Steps 5 and 6 sit inside the loop, so they repeat once per split document.


Step 1: How do you watch a Dropbox folder for scanned batches?​

Flow so far: nothing yet, this is the trigger.

  1. Add Dropbox as the trigger app and pick the New File in Folder event.
  2. Configure:
    • Space: Default
    • Folder: /SplitBarcodeAP/Input
    • Include files in subfolders?: False
    • Include file contents?: Yes
    • Include sharing link?: No

New File in Folder configuration​

Dropbox New File in Folder trigger configured with Space Default, Folder /SplitBarcodeAP/Input, Include files in subfolders False, Include file contents Yes, and Include sharing link No

Scanners often write a temporary file first. If your scanner does, point the trigger at the folder it moves the finished scan into, not the one it writes into.


Step 2: Why filter before splitting?​

Flow so far: New File in Folder.

  1. Add Filter by Zapier and open Filter conditions.
  2. Set Only continue if: 1. File Ext (Text) Contains pdf.

Filter conditions configuration​

Filter by Zapier step set to only continue if File Ext from step 1 contains pdf, with a green panel confirming the test record matched on File ext .pdf

Splitting is the most expensive step in this Zap, so gating it matters more here than in a lighter workflow. See Zapier's filter guide for stricter rules.


Step 3: How does Split by Barcode decide where to cut?​

Flow so far: New File in Folder plus Filter conditions.

Four required fields control the split. The barcode text and filter decide which codes count, and the split page decides which side of the separator the cut falls on.

  1. Add PDF4me and pick the Split by Barcode action.
  2. Configure:
    • File: the File output of step 1
    • Specify File Name: the File Name from step 1, here AP-Batch-Scan-Nov-01
    • Barcode Text: PDF4me Barcode
    • Barcode Filter: Starts with
    • Barcode Type: Only QR Code
    • Split Barcode Page: Before the barcode
    • PDF Render Dpi: 150
    • Combine Pages with Same Barcodes: False
    • Return as Zip: False

Split by Barcode parameters​

FieldValue usedWhat it controls
FileFile from step 1The scanned batch. Supply either File or File URL.
Specify File NameAP-Batch-Scan-Nov-01Base name the split documents are numbered from.
Barcode TextPDF4me BarcodeThe text the separator barcode carries.
Barcode FilterStarts withHow Barcode Text is matched. Required.
Barcode TypeOnly QR CodeRestricts detection to one symbology. Required.
Split Barcode PageBefore the barcodeWhich side of the separator the cut falls on. Required.
PDF Render Dpi150Rasterisation quality used to read the codes. Required.
Combine Pages with Same BarcodesFalseTrue merges every section sharing a barcode value into one file.
Return as ZipFalseFalse returns a list of documents, which is what the loop needs.
PDF4me Split by Barcode action configured with File from step 1, Specify File Name AP-Batch-Scan-Nov-01, Barcode Text PDF4me Barcode, Barcode Filter Starts with, Barcode Type Only QR Code, Split Barcode Page Before the barcode, PDF Render Dpi 150, Combine Pages with Same Barcodes False and Return as Zip False

Return as Zip stays False on purpose. A zip would be a single file, and the loop in step 4 needs the individual documents.

Tip. Barcode Type is set to Only QR Code here, which makes detection faster and avoids a stray Code 128 on an invoice being mistaken for a separator. Widen it only if your separators genuinely use several symbologies.


Step 4: How do you handle the list of split documents?​

Flow so far: New File in Folder plus Filter conditions plus Split by Barcode.

Step 3 returns many documents. A loop turns that list into one iteration per document, and everything after it runs once per item.

  1. Add Looping by Zapier and pick Create Loop From Line Items.
  2. Under Values to Loop, add two value sets:
    • url mapped to 3. Documents File Url
    • name mapped to 3. Documents File Name
  3. Configure:
    • Trim Whitespace: True
    • Loop iteration counter start: 1
    • Maximum number of Loop iterations: 500

Create Loop From Line Items configuration​

Looping by Zapier Create Loop From Line Items step with a beta warning banner, two value sets mapping url to Documents File Url and name to Documents File Name from step 3, Trim Whitespace True, counter start 1 and maximum 500 iterations

Both value sets matter. The url is what gets uploaded, the name is what the file is called, and they stay aligned because they come from the same line item.

Tip. Zapier labels Looping as a beta feature in the step itself, and it has real caps. Read how to create loops and the looping limitations before you point this at a batch of hundreds.


Step 5: Where does each split document go?​

Flow so far: New File in Folder plus Filter conditions plus Split by Barcode plus Create Loop From Line Items.

This step and the next sit inside the loop, so they run once per document.

  1. Add Dropbox and pick the Upload File action.
  2. Configure:
    • Space: leave unset
    • Folder: /SplitBarcodeAP/Output
    • File: the Url value from the loop, step 4
    • Overwrite: True
    • Specify File Name: the Name value from the loop, here AP-Batch-Scan-Nov-01_1
    • Specify File Extension: pdf
    • Include sharing link?: Yes

Upload File configuration​

Dropbox Upload File action inside the loop with Folder /SplitBarcodeAP/Output, File mapped from the loop Url, Overwrite True, Specify File Name mapped from the loop Name AP-Batch-Scan-Nov-01_1, extension pdf and Include sharing link Yes

Both File and Specify File Name come from the loop rather than from step 3 directly. That is what keeps document 2's bytes paired with document 2's name.


Step 6: How do you log every document that was produced?​

Flow so far: all five previous steps, with 5 and 6 repeating per document.

  1. Add Dropbox and pick the Create or Append to Text File action.
  2. Configure:
    • Space: leave unset
    • Folder: /SplitBarcodeAP/Log
    • File Name: split-barcode-log.txt
    • File Content: the literal text Split OK: followed by the Name value from the loop
    • Include sharing link?: Yes

Create or Append to Text File configuration​

Dropbox Create or Append to Text File action writing to /SplitBarcodeAP/Log/split-barcode-log.txt with File Content set to the literal Split OK followed by the loop Name value AP-Batch-Scan-Nov-01_1

Because this runs inside the loop, a batch of twelve documents produces twelve log lines, which is the quickest way to confirm the split count was right.


Run the Flow and Verify​

  1. Publish the Zap.
  2. Put a separator page in front of each document, scan the stack as one PDF, and drop it into /SplitBarcodeAP/Input.
  3. Open Zap runs and check the loop reports as many iterations as you had separators.
  4. Open /SplitBarcodeAP/Output and confirm one file per document, numbered _1, _2 and so on, then check split-barcode-log.txt has the matching lines.

What did you actually build? A mailroom. One scan pass replaces the sorting, and the separator sheet carries the instruction instead of a person remembering it. Point the same shape at purchase orders, delivery notes or signed contracts and only the barcode text changes.


Common Variations You Can Add Without Rebuilding​

Route by barcode value
Add a Paths step inside the loop and send documents to different folders based on what the separator barcode says.
OCR each document
Insert PDF OCR inside the loop so every split file becomes searchable before it is filed.
Combine sections sharing a code
Set Combine Pages with Same Barcodes to True when one document's pages are interleaved across the batch but carry the same barcode.
Return a zip instead
Set Return as Zip to True and drop the loop if you would rather archive the whole batch as one download.

Barcode splitting vs page-number splitting​

Method vs methodSplit by BarcodeSplit by page number
Documents of varying lengthHandled, the barcode marks the boundaryBreaks as soon as lengths differ
Setup per batchNone, the separator sheets travel with the paperSomeone works out the page numbers
Who prepares itWhoever stacks the paperWhoever opens the PDF afterwards
Scales to a hundred documentsYes, one scan passNot realistically
Needs a separator pageYesNo

Common questions​

How do I split a PDF into multiple files?​

Pick a rule for where the cuts fall. The usual rule is page numbers, which this action replaces with barcodes. PDF4me's Split by Barcode scans each page, finds the codes that match your Barcode Text and Barcode Filter, and returns a separate document for each section.

How do I split PDF pages into different files?​

If you want every page as its own file, barcode splitting is the wrong tool and a plain Split PDF action is simpler. Barcode splitting exists for the case where a file boundary is not the same as a page boundary, which is exactly what a scanned batch of multi page documents is.

What barcode types can be used to split a PDF?​

The Barcode Type dropdown selects the symbology the action looks for. This build uses Only QR Code, which keeps detection fast and avoids matching an unrelated barcode printed on an invoice. Restricting the type is usually the right call when your separator sheets are under your control.

Can I split a PDF without knowing the page numbers?​

That is the whole point of this method. You never state a page number anywhere in the Zap. The separator pages carry the boundary information, so a batch whose documents are two, five and nine pages long splits correctly without anybody counting.


Troubleshooting​

Only one file comes out

No barcode matched, so the batch was never cut. Check that Barcode Text matches what the separator actually encodes, that Barcode Filter is Starts with rather than an exact match, and that Barcode Type is not excluding your symbology.

Barcodes are missed on scanned pages

PDF Render Dpi is too low for the print quality. Raise it from 150 and retest. Skewed or faint separator sheets are the other usual cause, so reprint them rather than pushing DPI far up.

Only the first document gets saved

Steps 5 and 6 are outside the loop, or Return as Zip is True so there is only one item to iterate. Both put the Zap back to handling a single file.

The separator page appears in the wrong document

Split Barcode Page is set to After rather than Before. Before the barcode starts each new document at its own separator, which is what separator sheets are for.


Next Steps​

The same six step pattern (watch, gate, split, loop, save, log) handles any "one file in, many files out" automation.