mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.44k stars 9.98k forks source link

[Feature]: Add a generic interface or API for external implementations of AnnotationEditorLayer #18625

Closed TaTo30 closed 1 month ago

TaTo30 commented 2 months ago

Is the feature relevant to the Firefox PDF Viewer?

No

Feature description

Hi Mozilla team.

I have been looking to implement AnnotationEditorLayer using the node package pdfjs-dist and searching on the source code I've noticed that is mandatory to use an uiManager class to handle viewer events, user interactions and editors properties but this design is too difficult to brings up on custom solutions where the only features needed are adding, removing and saving annotations. Just for comparing AnnotationLayer and TextLayer are easy to implement with the current API.

I am well aware that your main focus is Firefox Viewer but could you consider add a generic API or interface on the medium/large term to allows dependents projects implement the editor layer with the most basic features: add/remove, save, drag/resize, without caring about keyboard events, multi-page dragging, toolbar options, etc.

Other PDF viewers

No response

Snuffleupagus commented 2 months ago

This unfortunately sounds like something that could/would add way too much code, complexity, and maintenance burden all for a feature that's unused (and untested) within the project itself. Please also note that the Editor is still under very active development, which means that we have to be able to make changes as needed without worrying about maintaining an API-surface.