Skip to content

Confirm and retag when a PDF is already tagged #501

Description

@bbertucc

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

Activity

  1. bbertucc commented on Oct 1, 2026

    @bbertucc
    MemberAuthor

    equalify-iris-pdf#7 has merged, so iris-pdf tag --retag is available on main.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions