Tagging a PDF that is already tagged shows an error in the demo: "Could not tag the PDF: The PDF is already tagged. Retagging it is not supported." Instead, Iris should warn that the PDF is already tagged and offer to retag it.
iris-pdf side: EqualifyEverything/equalify-iris-pdf#7
iris-pdf tag still refuses a tagged PDF: exit 1, stderr iris-pdf: already_tagged: The PDF is already tagged. Pass --retag to replace its tags. failure() in src/util/taggedPdf.ts already parses this into code already_tagged, and taggerError answers 422.
--retag replaces the old tags, and the report carries a retagged warning. On a PDF that iris-pdf tagged before, it restores the original page content first, so retagging does not stack text layers.
iris-pdf tag --help lists [--retag], so a deployment can probe for it.
Suggested change
- On
already_tagged, the demo (public/demo.html) shows a confirm, e.g. "This PDF is already tagged. Retagging replaces its existing tags with tags from Iris's HTML. Retag it?"
- On yes, it re-posts with
retag: true. The tag route in src/routes/sessions.ts passes that through, and tagPdf adds --retag to argv.
- Add a test with
test/fixtures/fake-iris-pdf.mjs.
🤖 Generated with Claude Code
Tagging a PDF that is already tagged shows an error in the demo: "Could not tag the PDF: The PDF is already tagged. Retagging it is not supported." Instead, Iris should warn that the PDF is already tagged and offer to retag it.
iris-pdf side: EqualifyEverything/equalify-iris-pdf#7
iris-pdf tagstill refuses a tagged PDF: exit 1, stderriris-pdf: already_tagged: The PDF is already tagged. Pass --retag to replace its tags.failure()insrc/util/taggedPdf.tsalready parses this into codealready_tagged, andtaggerErroranswers 422.--retagreplaces the old tags, and the report carries aretaggedwarning. On a PDF that iris-pdf tagged before, it restores the original page content first, so retagging does not stack text layers.iris-pdf tag --helplists[--retag], so a deployment can probe for it.Suggested change
already_tagged, the demo (public/demo.html) shows a confirm, e.g. "This PDF is already tagged. Retagging replaces its existing tags with tags from Iris's HTML. Retag it?"retag: true. The tag route insrc/routes/sessions.tspasses that through, andtagPdfadds--retagto argv.test/fixtures/fake-iris-pdf.mjs.🤖 Generated with Claude Code