Skip to main content
Version: 7.x

PDF Engines

The PDF Engines module gathers all engines that can manipulate PDF files.

info

It calls each engine until one successfully handles a task.

Properties

--pdfengines-engines        strings  Set the PDF engines and their order - all by default
--pdfengines-disable-routes bool Disable the routes
tip

If you don't need all PDF engines, you may select only those you're interested in.

For instance --pdfengines-engines=pdftk,uno-pdfengine selects PDFtk as the first engine, and UNO as the second.

Routes

Each route accepts multipart/form-data requests.

Merge

POST /forms/pdfengines/merge

This route accepts PDF files and merges them alphabetically.

For instance:

curl \
--request POST 'http://localhost:3000/forms/pdfengines/merge' \
--form 'files=@"/path/to/pdf1.pdf"' \
--form 'files=@"/path/to/pdf2.pdf"' \
--form 'files=@"/path/to/pdf3.pdf"' \
--form 'files=@"/path/to/pdf4.pdf"' \
-o my.pdf
pdfFormat string  The PDF format of the resulting PDF

For instance:

curl \
--request POST 'http://localhost:3000/forms/pdfengines/merge' \
--form 'files=@"/path/to/pdf1.pdf"' \
--form 'files=@"/path/to/pdf2.pdf"' \
--form 'files=@"/path/to/pdf3.pdf"' \
--form 'files=@"/path/to/pdf4.pdf"' \
--form 'pdfFormat="PDF/A-1a"' \
-o my.pdf
info

After a merge, the PDF engines will convert the resulting PDF to a specific format.

Check the available PDF formats:

Convert

POST /forms/pdfengines/convert

This route accepts PDF files and a form field pdfFormat for converting them into the specified format.

For instance:

curl \
--request POST 'http://localhost:3000/forms/pdfengines/convert' \
--form 'files=@"/path/to/pdf1.pdf"' \
--form 'files=@"/path/to/pdf2.pdf"' \
--form 'files=@"/path/to/pdf3.pdf"' \
--form 'files=@"/path/to/pdf4.pdf"' \
--form 'pdfFormat="PDF/A-1a"' \
-o my.zip

Engines

PDFtk

  • Module name: pdftk
  • ✅ Merge
  • ❌ Convert

This engine uses PDFtk - give it a star ⭐️

PDFcpu

  • Module name: pdfcpu
  • ✅ Merge
  • ❌ Convert

This engine uses PDFcpu - give it a star ⭐️

QPDF

  • Module name: qpdf
  • ✅ Merge
  • ❌ Convert

This engine uses QPDF - give it a star ⭐️

UNO

  • Module name: uno-pdfengine
  • ❌ Merge
  • ✅ Convert (formats: PDF/A-1a, PDF/A-2b, PDF/A-3b)

This engine uses unoconv - give it a star ⭐️

Metrics

The PDF Engines module exposes the following metrics:

  • {namespace}_pdftk_active_instances_count - current number of active PDFtk instances.
  • {namespace}_qpdf_active_instances_count - current number of active QPDF instances.
  • {namespace}_unoconv_active_instances_count - current number of active unoconv instances.
  • {namespace}_libreoffice_listener_active_instances_count - current number of active LibreOffice listener instances.
  • {namespace}_libreoffice_listener_queue_length - current number of processes in the LibreOffice listener queue.
caution

The metrics unoconv_listener_active_instances_count and unoconv_listener_queue_length are deprecated in favor of libreoffice_listener_active_instances_count and libreoffice_listener_queue_length.

See Prometheus for more details.