Skip to main content

Split PDF by Barcode in Power Automate: Step-by-Step with Dropbox and PDF4me

· 7 min read
SEO and Content Writer

You have a multi-document PDF—batch-scanned invoices, mail with separator sheets, or reports with barcode dividers—and you need each document split into its own file. Doing that manually is tedious. PDF4me Split PDF by Barcode detects barcodes in the PDF, filters by text (e.g. starts with PDF4me), and splits before, after, or at the barcode page. In Power Automate, you wire it up in five steps: triggerget file content (Dropbox) → Barcode – Split Document by Barcode (PDF4me) → Apply to eachCreate file (Dropbox).

This guide is fact-checked against the Power Automate UI and the Split PDF by Barcode action reference. Every parameter, path, and output field matches a real run. At the end, we include the raw response structure and links to try the API interactively.

What You Need

  • Power AutomateOpen Power Automate, sign in (Microsoft 365 / Power Platform), and create a new cloud flow (Instant or Automated).
  • PDF4me API keyGet your PDF4me API key. Create a connection when you add the Barcode – Split Document by Barcode action. First time? See Connect PDF4me to Power Automate.
  • Dropbox — We use Dropbox for Get file content and Create file. You can swap in SharePoint, OneDrive, or another connector that provides file content and create-file actions.

The Flow at a Glance (5 Steps)

  1. Manually trigger a flow — Start the flow on demand (or use When a file is created in Dropbox for automation).
  2. Get file content using path (Dropbox) — Fetches the PDF from a path like /blog data/split by barcode/barcode.pdf.
  3. Barcode – Split Document by Barcode (PDF4me) — Splits the PDF by detected barcodes. Output: splitedDocuments array (each item has fileName, streamFile, barcodeText).
  4. Apply to each — Loops over each split document.
  5. Create file (Dropbox) — Saves each split PDF to the output folder using fileName and streamFile from the loop.
Power Automate flow: Manually trigger → Get file content → Barcode - Split Document by Barcode → For each → Create file

Input: One PDF (barcode.pdf) containing multiple documents separated by barcodes. Output: Multiple PDFs (e.g. PDF4me Barcode 1.pdf, PDF4me Barcode 2.pdf) in the same folder.

Input: barcode.pdf in folder

Input: barcode.pdf

Output: PDF4me Barcode 1.pdf, PDF4me Barcode 2.pdf

Output: PDF4me Barcode 1.pdf, PDF4me Barcode 2.pdf


Step 1: Trigger + Get File Content

Flow so far: Trigger → Get file content.

  1. Add Manually trigger a flow (or When a file is created in Dropbox for automation).
  2. Add DropboxGet file content using path.
  3. Parameters:
    • File Path * — Enter the path to your PDF, e.g. /blog data/split by barcode/barcode.pdf. Use the folder icon to browse if needed.
    • Advanced parametersInfer Content Type — Set to Yes.
  4. Connection — Ensure Connected to Dropbox.

The output is the file content (binary). Map it to File Content in the Split action.

Get file content: File Path /blog data/split by barcode/barcode.pdf, Infer Content Type Yes

Step 2: Barcode – Split Document by Barcode (PDF4me)

Flow so far: Trigger → Get file content → Split Document by Barcode.

  1. Add PDF4meBarcode – Split Document by Barcode.
  2. Parameters (fact-checked from screenshot):
    • File Content * — Map Get file content using path output (the PDF binary).
    • File Name * — Enter a template such as {barcode} or the source filename (e.g. barcode.pdf). The action uses this to generate output filenames.
    • Barcode Filter * — Choose Starts With (or Ends With, Contains, Exact).
    • Barcode Data * — Enter the text to match (e.g. PDF4me). Only barcodes whose text matches this filter trigger a split.
    • Barcode Type *Any (or QR Code, Data Matrix if you want to restrict).
    • Split Barcode Page *Before (split before the barcode page), After (split after), or Remove (split and remove the barcode page).
  3. Advanced parameters (expand if needed):
    • Combine PagesNo (split at every matching barcode) or Yes (combine consecutive pages with the same barcode).
    • PDF Render DPI — e.g. 150 (higher = better barcode detection, slower processing).
    • Is AsyncNo for synchronous (recommended for flows).
  4. ConnectionConnected to PDF4me Barcode.
Barcode - Split Document by Barcode: File Content, File Name {barcode}, Barcode Filter startsWith, Barcode Data PDF4me, Split Barcode Page before

Output: The action returns body with splitedDocuments—an array. Each item has:

  • fileName — Name of the split PDF (e.g. PDF4me Barcode 1.pdf).
  • streamFile — Base64-encoded PDF content.
  • barcodeText — The barcode value that caused this split (e.g. PDF4me Barcode 1).
Raw response: splitedDocuments array with fileName, streamFile, barcodeText for each split

Step 3: Apply to Each + Create File

Flow so far: … → Split Document by Barcode → Apply to each → Create file.

  1. Add Apply to each.
  2. Select an output from the previous steps — Choose bodysplitedDocuments (or the equivalent from Barcode – Split Document by Barcode).
  3. Inside the loop, add DropboxCreate file.
  4. Parameters:
    • Folder Path * — Target folder (e.g. /blog data/split by barcode).
    • File Name * — Map fileName from the current item (dynamic content from the Split action).
    • File Content * — Map streamFile from the current item (dynamic content from the Split action).
  5. ConnectionConnected to Dropbox.
Create file: Folder Path, File Name from fileName, File Content from streamFile (Barcode - Split Document by Barcode outputs)

Each iteration creates one file. After the loop completes, you have one PDF per detected barcode in the output folder.


Summary: Parameters and Output (Fact-Checked)

ParameterValue in our exampleDescription
Barcode FilterStarts WithMatch barcodes whose text starts with Barcode Data
Barcode DataPDF4meText to filter barcodes
Split Barcode PageBeforeSplit before the page containing the barcode
OutputsplitedDocumentsArray of { fileName, streamFile, barcodeText }

For full parameter details and options, see Split PDF by Barcode — Power Automate.


Try the API Interactively

You can test the Split PDF by Barcode API without Power Automate using our API Tester—upload a PDF, set barcode filter and text, and see the response:


Next Steps

  1. Run the flow — Add a test PDF with barcodes to your Dropbox folder and run the flow. Check the output folder for split PDFs.
  2. Adjust filters — Change Barcode Data and Barcode Filter (Contains, Exact, etc.) to match your documents.
  3. Automate — Replace Manually trigger with When a file is created (Dropbox) and map the trigger’s file path to Get file content.