Free plan
Split scan by barcode
Split a batch scan into separate PDFs by barcode sheets
About this tool
When you scan a big pile of different documents, you can put a sheet with a barcode or QR code between them. This tool reads the codes on the pages and cuts the scan into separate PDFs where a separator sheet appears, or where the code value changes. Each file can be named from its code. All files come in one ZIP.
For example, you scanned a batch of customer forms with a barcode sheet before each customer and want one PDF per customer.
How to use it
- Choose this tool.
- Add your scanned PDF.
- Choose whether a separator sheet starts a new document, or a change in code value does.
- If needed, type which codes count, whether to drop the separator sheets and whether to name files from the code.
- Press Generate, then download the ZIP.
What you get back
You get a ZIP file holding one PDF per document. You can download it and unpack it.
GOOD TO KNOW
A code is read from the picture of each page. Without any code the whole file is returned as one document, with a warning. Counts as one PDF operation.
TEST IT LIVE
Try Split scan by barcode in the Studio
One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Family
PDFs
Plan
Free
Method
POST
Endpoint
/v1/pdfs/split-by-code
Tool ID
pdfs.split-by-code
Authentication
API key
Accepts
PDF
Background jobs
Yes
Usage group
Pdf
For developers
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/pdfs/split-by-code" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'mode=separator' \
-F 'pattern=SPLIT*' \
-F 'unmatched=previous'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.pdfs.splitByCode({
"file": 'document.pdf',
"mode": "separator",
"pattern": "SPLIT*",
"unmatched": "previous"
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->pdfs()->splitByCode([
'file' => 'document.pdf',
'mode' => 'separator',
'pattern' => 'SPLIT*',
'unmatched' => 'previous',
]);
echo $result->requestId;More in PDFs
