Skip to content

feat(edit): add, edit and remove PDF link annotations (#35) - #55

Open
nonamexishere wants to merge 3 commits into
McanKul:developmentfrom
nonamexishere:feat/35-pdf-link-annotations
Open

feat(edit): add, edit and remove PDF link annotations (#35)#55
nonamexishere wants to merge 3 commits into
McanKul:developmentfrom
nonamexishere:feat/35-pdf-link-annotations

Conversation

@nonamexishere

Copy link
Copy Markdown
Contributor

Summary

Implements #35: manage standard URI and in-document GoTo link annotations on Edit PDF.

This is a different job from #54 (#34 publish gate). Save still uses that gate, so this branch is stacked on it.

Depends on #54. Please merge #54 first. After that this PR rebases to link-only commits. Merging this before #54 would also land the validation gate.

In scope

  • Detect existing /Link annotations whose action is allowlisted URI (https / http / mailto) or in-document GoTo
  • Show those hotspots on the canvas (dashed rect, same Crop/Rotate space as stamps)
  • Create, edit, and remove supported links
  • Leave JS / Launch / file / remote-GoTo and unrelated annotations unchanged
  • Save writes real /Annots, then the test(editor): validate and round-trip edited PDF outputs before publish #34 qpdf --check + snapshot gate
  • Original file is never overwritten

Out of scope

Why

Overlay stamps are not PDF links. Viewers need /Subtype /Link + /A.

Validation

  • npm run typecheck
  • npm test (180)
  • cargo test --manifest-path src-tauri/Cargo.toml --lib (120)
  • Manual Edit PDF with local QA PDFs (URI, GoTo, mixed, rotate+crop, clean)

Privacy Checklist

  • This keeps OffPDF usable offline.
  • This does not upload, log, or transmit user files. URIs are not fetched.
  • New dependencies or bundled binaries have compatible licenses.

Validate staged Edit PDF output before the destination rename so a
truncated or structurally wrong file cannot replace the user's dest.
qpdf --check errors are fatal; warnings are recorded and do not block.
Fixes McanKul#34.
Re-check cancel after qpdf --check and before publish so a mid-gate
Cancel returns CANCELLED, deletes staging, and does not replace dest.
Production --check registers on the job handle like overlay qpdf.
Detect existing allowlisted URI and in-document GoTo annotations,
show them on the Edit PDF canvas, and write real /Link dictionaries
on save after overlay. Unsupported actions are left in place.
Uses the McanKul#34 staged-output gate. Fixes McanKul#35.
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