Skip to content

docs: pair pdfua with PDF/A-2b in the cURL examples - #51

Open
fstandhartinger wants to merge 1 commit into
gotenberg:mainfrom
fstandhartinger:docs/pdfua-examples-pdfa-2b
Open

fstandhartinger wants to merge 1 commit into
gotenberg:mainfrom
fstandhartinger:docs/pdfua-examples-pdfa-2b

Conversation

@fstandhartinger

@fstandhartinger fstandhartinger commented Nov 1, 2026 •

Copy link
Copy Markdown

The PDF/A & PDF/UA cURL examples send pdfa=PDF/A-1b together with pdfua=true. The warning on the LibreOffice page already says this pairing has no effect, so anyone who copies the example gets a PDF/A-1b file with no PDF/UA. This PR switches the four examples to PDF/A-2b, which the same warning recommends. The PDF/A-1b option stays documented as it was.

Changed (4 lines, docs only):

  • docs/_shared/_pdfa_pdfua_pdfengines.mdx, both cURL blocks (used by the Chromium and PDF-engine pages)
  • docs/convert-with-libreoffice/convert-to-pdf.mdx, the PDF/A & PDF/UA example
  • docs/manipulate-pdfs/pdfa-pdfua.mdx, the /forms/pdfengines/convert example

Why it fails. LibreOffice writes PDF/A-1 as PDF 1.4 (vcl/source/pdf/pdfwriter_impl.cxx), and since core commit f9d6125020 ("pdf: enable PDF/UA only when writing PDF version 1.7 or 2.0", LibreOffice 25.8+) it only turns PDF/UA on for PDF 1.7 or 2.0. /forms/pdfengines/convert goes through the same LibreOffice export via libreoffice-pdfengine, so it is affected too.

Measured with LibreOffice 26.8.2.2 (the 26.8 line in trixie-backports), using the filter options Gotenberg passes (SelectPdfVersion, EmbedStandardFonts, PDFUACompliance=true, UseTaggedPDF=true), on a small HTML document:

SelectPdfVersion PDF header pdfaid:part pdfuaid:part
1 (PDF/A-1b) %PDF-1.4 1 absent
2 (PDF/A-2b) %PDF-1.7 2 1
3 (PDF/A-3b) %PDF-1.7 3 1

I didn't run a Gotenberg container for this. The measurement is LibreOffice itself, called with the same export options.

Checklist

  • Form field names and values match the API (PDF/A-2b is an accepted pdfa value)
  • cURL examples stay valid and copy-pasteable
  • prettier --check passes on the changed files
  • npm run build passes
  • Not checked in a browser at the three widths. The change is one token inside existing code blocks.

Disclosure: I build a hosted document-generation API. Nothing of it is linked or mentioned in the docs here. This PR, including the measurement above, was prepared with AI assistance (Claude Code).

🤖 Generated with Claude Code

The PDF/A & PDF/UA examples sent pdfa=PDF/A-1b together with
pdfua=true. The warning on the LibreOffice page already says this
pairing has no effect: LibreOffice writes PDF/A-1 as PDF 1.4 and only
enables PDF/UA at PDF 1.7 or 2.0. Use PDF/A-2b so the examples produce
what they request.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant