Skip to main content

Want Your PDFs to Last Decades? Compress and Archive in n8n. One Workflow Does It All!

· 12 min read
SEO and Content Writer

Regular PDFs can age poorly. Fonts go missing, colors shift, links break. PDF/A (ISO 19005) fixes that: fonts, images, and color profiles are embedded so documents stay readable for decades. In n8n, you can automate the full chain: get a PDF (Dropbox Download a file, Read/Write Files from Disk, or—for a quick test—When clicking ‘Execute workflow’ with Base64 in Compress PDF), run Compress PDF, then Create PDF/A. Add Upload a file when you want the PDF/A back in cloud storage.

In a nutshell: Trigger (e.g. When clicking ‘Execute workflow’ for tests, or Dropbox Download a file for real paths like /Blog Data/PDFA/Sample PDF.pdf) → PDF4me – Compress PDF (e.g. Optimize Profile Web, binary output name data) → PDF4me – Create PDF/A (Resource Convert, operation Create PDF/A, e.g. PDF/A-1b). Optional: Upload a file to save converted_pdfa.pdf (or your chosen name) to Dropbox.

Why Compress First, Then Create PDF/A?

Compressing shrinks the file before archiving—smaller files transfer and store faster. Create PDF/A embeds fonts, removes external dependencies, and locks the document for long-term preservation. Together they give you a compact, standards-compliant archive. If you prefer to skip compression, pass the PDF binary from your download or trigger straight into Create PDF/A.

Complete workflow overview

n8n workflow: When clicking Execute workflow → Compress PDF → Create PDF/A (PDF4me), each step successful

Canvas: manual trigger → Compress PDFCreate PDF/A. Green checkmarks show a successful test run; swap the trigger for Dropbox or another app when you go to production.


What You'll Get

Input: A regular PDF (e.g. Sample PDF.pdf) in a Dropbox folder or from another trigger. Output: An archival PDF/A file—ready for compliance, audits, or long-term archives. Add an Upload node to save it to cloud storage.


What You Need

  • n8n — Self-hosted or n8n Cloud. Add the PDF4me and Dropbox nodes.
  • PDF4me API keyGet your API key. Connect it when you add PDF4me nodes. First time? See Connect PDF4me to n8n.
  • Dropbox — For the source PDF folder. Google Drive or other storage with a Download node works too.

The Workflow: Core Nodes (Plus Optional Upload)

  1. TriggerWhen clicking ‘Execute workflow’ (screenshots below), or Dropbox – Download a file / When a file is created for production.
  2. Compress PDF (PDF4me, resource Optimize Compress) — Shrinks the PDF before archiving.
  3. Create PDF/A (PDF4me, resource Convert, operation Create PDF/A) — Produces an archival-compliant file.
  4. (Optional) Upload a file (Dropbox, etc.) — Saves the PDF/A to an output folder.

Step 1: Trigger and get PDF bytes

Workflow so far: Trigger only (and any node that supplies the PDF).

  1. For a quick test (matches the overview screenshot), add When clicking ‘Execute workflow’ and, in Compress PDF, use Input Data Type: Base64 String and paste or map Base64 PDF Content (as in step 2).
  2. For Dropbox, add Download a file with File Path e.g. /Blog Data/PDFA/Sample PDF.pdf, or map the path from When a file is created. Then use Input Data Type: Binary Data in Compress PDF and map the binary field (often data) from the download node.
  3. Execute the chain up to Compress PDF to confirm the PDF reaches PDF4me.

Step 2: Compress PDF

Workflow so far: Trigger → Compress PDF.

  1. Add PDF4meCompress PDF (Resource: Optimize Compress, Operation: Compress PDF).
  2. Input Data TypeBinary Data if the previous node outputs a file binary; Base64 String if you are testing with encoded content (as in the screenshot).
  3. Input Binary Field or Base64 PDF Content — Map from the previous node or paste base64 for a manual test.
  4. Output File Name — e.g. compress_PDF_output.pdf.
  5. Optimize ProfileWeb, Print, Screen, or Default (example uses Web).
  6. Async — On or off per your needs (example has it on).
  7. Binary Data Output Name — e.g. data so Create PDF/A can read the same property name.
  8. Connect your PDF4me credential and Execute step. On success, the OUTPUT panel shows the compressed PDF binary (e.g. compress_PDF_output.pdf, ~62.9 kB in the reference run).

Compress PDF: parameters and successful output

n8n PDF4me Compress PDF: Parameters left (Base64 or Binary, Optimize Profile Web, output name data) and OUTPUT Binary tab with compress_PDF_output.pdf

Left: credential, Resource Optimize Compress, profile Web, binary output name data. Right: OUTPUTBinary with the compressed file ready for Create PDF/A.


Step 3: Create PDF/A

Workflow so far: Trigger → Compress PDF → Create PDF/A.

  1. Add PDF4me → set Resource to Convert and Convert Operations to Create PDF/A.
  2. Input Data TypeBinary Data.
  3. Input Binary Fielddata (or the same name you set as Binary Data Output Name on Compress PDF).
  4. Output File Name — e.g. converted_pdfa.pdf.
  5. Binary Output Property Name — e.g. data.
  6. Document Name — e.g. document.pdf (metadata reference).
  7. PDF/A Compliance — e.g. PDF/A-1b (Level B Basic).
  8. Under Advanced, set Allow Upgrade / Allow Downgrade and optional Custom Profiles as needed (example shows Allow Upgrade on).
  9. Connect your PDF4me credential and execute.

Create PDF/A: input from Compress PDF (Binary tab)

Open the Create PDF/A node and check INPUTBinary: the item should show the file coming from Compress PDF (e.g. compress_PDF_output.pdf).

n8n Create PDF/A node INPUT Binary tab: data from Compress PDF node, file compress_PDF_output.pdf application/pdf

Input dropdown set to Compress PDF, Binary tab: confirms the compressed PDF is wired into Create PDF/A.

Create PDF/A: parameters

n8n PDF4me Create PDF/A parameters: Resource Convert, Create PDF/A, Binary input field data, Output converted_pdfa.pdf, PDF/A-1b compliance

Parameters tab: Resource Convert, operation Create PDF/A, binary field data, output converted_pdfa.pdf, compliance PDF/A-1b.

Create PDF/A: output binary

n8n Create PDF/A OUTPUT Binary: converted_pdfa.pdf application/pdf archival result

Successful run: OUTPUTBinary shows converted_pdfa.pdf (e.g. ~62 kB). Use Download to inspect locally or pass data to an Upload node.


Who Uses "Compress Then Archive"? Real-World Examples

Legal and courts: Electronic filings and exhibits often need PDF/A for long-term retention. Compress first to reduce storage, then archive for compliance.

Healthcare and pharma: Patient records, consent forms, and trial documentation require archival for regulatory audits. PDF/A ensures readability for decades.

Government and archives: Digitized records, permits, and filings need permanent preservation. Compress to save space, then create PDF/A for standards compliance.


Quick Reference: Key Settings

NodeSettingExample
1. Trigger / DownloadManual test or File PathExecute workflow + Base64, or /Blog Data/PDFA/Sample PDF.pdf
2. Compress PDFProfile, binary out nameWeb; data
3. Create PDF/APDF/A CompliancePDF/A-1b (or 2b, 3b)

For full parameter details, see Compress PDF — n8n and Create PDF/A — n8n.


Troubleshooting

Binary not found or empty

If you use Binary Data, the previous node must output binary and the field name (often data) must match Input Binary Field on Compress PDF and Create PDF/A. If you use Base64 String for tests, ensure the string is valid PDF base64.

Create PDF/A: pass binary from Compress PDF

Map Input Binary Field to the binary output from the Compress PDF node. If you skip compression, use the binary from the Download node instead.

401, 402, or other API errors

PDF4me Troubleshooting covers 401 (API key), 402 (credits), and more.


What's Next?

  • Add Upload a file (Dropbox, Google Drive) after Create PDF/A to save the PDF/A to an output folder.
  • Replace the manual trigger with When a file is created in Dropbox to process every new PDF automatically.
  • Need to convert Word to PDF first? See Word to PDF/A in Zapier or Make for the full convert → compress → archive flow.