From 10c007348968dd161b44aab50236105213de7f6c Mon Sep 17 00:00:00 2001 From: Blake Bertuccelli-Booth <46652+bbertucc@users.noreply.github.com> Date: Tue, 6 Oct 2026 18:13:21 -0400 Subject: [PATCH 1/4] feat(pdf): a flat form's fill-in list comes from the fields tagging makes A scanned or flat PDF has no form fields, so the demo offered nothing to fill in. iris-pdf 4533bdf (#13) makes fields from the HTML's controls, named the same way on every run. GET /fields now tags such a PDF once, with no values, and lists the fields on the output. /pdf then fills them by those names. Only when the source has no fields, the session is extracted, and the HTML has an input, select or textarea. A failed tag lists none; the download reports the error. Co-Authored-By: Claude Opus 5.5 --- docs/API.md | 3 +- public/demo.html | 4 +- src/routes/sessions.ts | 67 ++++++++++++++++++++++----------- src/util/taggedPdf.ts | 19 +++++++++- test/fixtures/fake-iris-pdf.mjs | 12 +++++- test/tagged-pdf.test.ts | 58 ++++++++++++++++++++++++++-- 6 files changed, 133 insertions(+), 30 deletions(-) diff --git a/docs/API.md b/docs/API.md index d80c57d0..017bbc97 100644 --- a/docs/API.md +++ b/docs/API.md @@ -987,7 +987,8 @@ curl -s -H "$AUTH" "$BASE/sessions/$SID/fields" | jq '.fields[0]' ``` `type` is one of `text`, `checkbox`, `radio`, `combobox`, `listbox`, `button` or `signature`. A PDF with -no form gives `{"fields": []}`. It can answer `404`, `409 no_source_pdf`, `422` for a PDF the tagger +no form gives `{"fields": []}`, unless its HTML has form controls. Then tagging makes the fields, so this +tags the PDF once and lists those, by the names `/pdf` fills. It can answer `404`, `409 no_source_pdf`, `422` for a PDF the tagger refuses, or `503 busy`, the same as below. **Get the tagged PDF:** diff --git a/public/demo.html b/public/demo.html index a4b197e8..37c128dd 100644 --- a/public/demo.html +++ b/public/demo.html @@ -167,8 +167,8 @@

Your accessible HTML

+ the upload was one PDF. The fields come from that PDF, or for a flat form from + tagging it (GET .../fields), so the form is built when the result is shown. -->