Skip to main content

Repair PDF in Make

What this module does

PDFs get corrupted at every stage of an automated pipeline - a cloud upload that drops mid-transfer, a mail server that re-encodes a binary attachment, a ZIP archive that only partially extracts, or a legacy file that has suffered years of storage bit-rot. When a broken PDF hits a downstream module - a converter, an AI parser, a forms extractor - the entire scenario fails. PDF4me - Repair PDF intercepts the problem before it propagates: it rebuilds missing cross-reference tables, fixes broken stream object boundaries, reconstructs page trees, and corrects end-of-file markers, returning a structurally sound document that every downstream module can process. Files with no damage pass through unchanged, so you can safely add this module as a universal precautionary step on every PDF entering your Make scenario - no conditional branching required.

Authenticating Your API Request

Every PDF4me module in Make requires a valid Connection. Create or select one that holds your PDF4me API key so the scenario can call the repair service securely.

Important Facts You Should Not Miss

Document must be real binary - not a URL or filename

Set File to Map and wire the Document field to actual PDF bytes from a download module - the Data field in Dropbox, Google Drive, OneDrive, or HTTP. Passing a file URL or a filename string here causes an immediate failed run, not a repair attempt. The module needs raw binary to inspect and reconstruct the PDF structure.

Safe on healthy files - no changes made if the PDF is undamaged

If the PDF passes structural validation, the module returns it byte-for-byte unchanged. There is no risk of altering or re-encoding a healthy document. This means you can place Repair PDF as a permanent step in any pipeline - before an invoice parser, before a converter, before an AI extractor - without needing a condition to check for damage first.

Recovery is not guaranteed - always add an error handler

The module can rebuild structural damage - broken xref tables, misaligned streams, truncated bodies - but cannot recover files where the majority of binary content is missing, or files encrypted with an unknown password. For these cases the module throws an error. Right-click the module, add an error handler, and route unrecoverable files to a Slack alert, an email notification, or a quarantine folder so nothing silently disappears from your pipeline.

Make PDF4me Repair PDF module showing Connection set to TestUser01, File configured as Map, File Name mapped from step 2 File Name, and Document mapped from step 2 Data from a prior Dropbox download module

Set File to Map, then connect File Name and Document from the module that downloaded the PDF. The Doc Data output carries the rebuilt file to any next step.

Parameters

Required: Connection, File Name, and Document. Set File to Map first - this reveals the File Name and Document fields in the module panel.

ParameterRequiredWhat it doesExample mapping
ConnectionYesPDF4me API connection that authenticates the repair request. Click Add to create one by pasting your PDF4me API key - reused automatically across all PDF4me modules in your scenarios.Your PDF4me connection
FileYesHow the PDF is supplied to the module. Always choose Map when passing binary content from a prior download step. The Map option reveals the File Name and Document fields below.Map
File NameYesOriginal filename of the PDF including the .pdf extension. Used to name the repaired output file returned in the Doc Data field. Map from the filename output of your Dropbox, Google Drive, OneDrive, or HTTP module.2. File Name
DocumentYesBinary content of the PDF to repair. Must be raw file bytes from a download module - the Data field in Dropbox, Google Drive, or OneDrive. Do not pass a file URL or a filename string here; the module requires actual binary to inspect and reconstruct the file structure.2. Data

Output Fields

FieldTypeWhat it contains
NameStringFilename of the repaired PDF derived from the File Name you supplied. Map this into storage module name fields.
Doc DataBufferBinary content of the rebuilt PDF. Map directly into any upload, send, convert, or processing module. For Google Drive or Dropbox upload, this maps to the Data field.

Quick Setup

  1. Add PDF4meRepair PDF to your Make scenario.
  2. Select Connection - or click Add and paste your API key to create one.
  3. Under File, choose Map to reveal the File Name and Document fields.
  4. Map File Name to the filename output of your download step (must include .pdf).
  5. Map Document to the binary data field of the same step - usually named Data.
  6. Right-click the module and add an Error Handler to catch files that cannot be recovered.
  7. Save and click Run once. The Doc Data output holds the repaired PDF buffer - wire it into any storage upload, conversion, or processing module downstream.

Workflow Examples

Workflow ExamplesCommon Make scenario patterns that include a Repair PDF step.
Email attachment intake → Repair → AI invoice parser
  1. Gmail Watch Emails triggers on new messages with PDF attachments from known supplier domains.
  2. Repair PDF runs on every attachment - mail server MIME re-encoding frequently corrupts binary streams in transit.
  3. The repaired Doc Data feeds into AI-Invoice Parser - no failed runs from structurally broken inputs.
  4. Extracted invoice fields (vendor, amount, due date) write to a Google Sheet or Airtable record automatically.
  5. Error handler routes unrecoverable attachments to a Slack alert for manual follow-up.
Legacy archive migration → Repair → Validate PDF/A → New storage
  1. A scheduled scenario lists all PDFs in a legacy Dropbox folder containing documents from 2010–2018.
  2. Each file is downloaded and passed through Repair PDF to fix bit-rot and encoding drift accumulated over years.
  3. Validate PDF/A checks conformance on the repaired output.
  4. Conforming files upload to the new SharePoint archive library. Non-conforming files log to a Google Sheet with filename and error for manual review.
Client portal upload → Repair → Convert to PDF/A → Compliance archive
  1. A client uploads a signed contract PDF via a Typeform or JotForm portal - upload interruptions on slow connections often truncate the file.
  2. Repair PDF reconstructs any structural damage from the upload before any processing begins.
  3. Create PDF/A converts the repaired document to a long-term archival format.
  4. The PDF/A file saves to a SharePoint compliance folder. A confirmation email with a download link goes to the client automatically.

Frequently Asked Questions

What types of PDF corruption can the Repair PDF module fix?+
The module repairs structural damage - missing or broken cross-reference (xref) tables, truncated file bodies, misaligned stream object boundaries, incorrect end-of-file markers, and certain encoding errors introduced by mail servers or ZIP extraction tools. It cannot recover files with severe physical corruption caused by bad storage sectors, files encrypted with an unknown password, or documents where the majority of the binary content is simply absent. For those cases the module throws an error that your Make error handler can catch and route.
Why do PDFs get corrupted in automated Make workflows?+
The most common causes are: cloud upload interruptions where a network drop cuts off the transfer mid-file; mail server MIME encoding that adds line breaks inside binary streams when forwarding attachments; partial ZIP or archive extraction where the package itself was incompletely downloaded; and long-term storage bit-rot in legacy systems where magnetic or optical media degrades over years. All of these can corrupt a PDF's internal structure without changing its visible file size, making them impossible to detect without a structural check.
Is it safe to run Repair PDF on every file even when I am not sure it is damaged?+
Yes - this is actually the recommended approach. If the document passes the internal structural check, the module returns it byte-for-byte unchanged. No re-encoding, no compression, no alteration of any kind is applied to a healthy file. Placing Repair PDF as a universal first step before any converter, extractor, or AI parser means your downstream modules always receive a structurally valid PDF, eliminating an entire class of intermittent failures from your pipeline.
What happens when a PDF cannot be repaired?+
The module throws an error that Make's built-in error-handling system can catch. Right-click the Repair PDF module, add an error handler, and configure a route for unrecoverable files. Common patterns: post a Slack message with the filename and error to a #pdf-errors channel; append a row to a Google Sheet error log with the file path, timestamp, and failure reason; or move the file to a "Quarantine" folder in Dropbox or Google Drive for manual inspection. This keeps the rest of your scenario processing healthy files without interruption.
Should I combine Repair PDF with Validate PDF/A in the same scenario?+
Yes, for archival and compliance workflows this two-stage approach is best practice. Repair PDF fixes structural damage first, then Validate PDF/A confirms the rebuilt document meets the conformance level you require (PDF/A-1b, PDF/A-2b, etc.) before it goes into long-term storage or gets distributed to clients. The combination gives you a quality gate that catches both damaged files and valid-but-non-conformant files in a single scenario run.

Get Help