Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature to save annotations in JSON format following the Web Annotation Data Model #15055

Closed
jaime-rivas opened this issue Jun 17, 2022 · 3 comments

Comments

@jaime-rivas
Copy link

Hi everyone,

@marco-c @calixteman @Snuffleupagus it's absolutely fantastic that you are adding editing capabilities to pdf.js to bring full annotation support, big thank you!

Giving this current effort, I wanted to suggest a related capability that might be very useful and hopefully achievable at the same time. In addition to supporting saving annotations in the native PDF annotation format inside the PDF, it would be great to have the option to save annotations outside the PDF in JSON format following the Web Annotation Data Model.

This will allow annotation libraries like Apache Annotator to externally load those annotations, enable collaborative annotations scenarios, etc. using the W3C’s standard Web Annotation data model. Related issue here: Fragment selector for PDFs + PDF.js integration

Thank you again!

@Snuffleupagus
Copy link
Collaborator

[...] that you are adding editing capabilities to pdf.js to bring full annotation support

I don't believe it's going to be "full" editing support, given the sheer number of Annotation-types that the PDF specification support, but most likely rather a few commonly used types.

[...] it would be great to have the option to save annotations outside the PDF in JSON format following the Web Annotation Data Model.

It sounds like that could very well require a fair amount of code, for a use-case that's potentially not entirely relevant for the Firefox built-in PDF Viewer. (Without having really looked at the linked specification...)

However, note that you're already able to access modified Annotation-data through the PDF.js API (but please keep in mind that editing is still unfinished/unreleased); refer to:

Hence it'd likely be possible to implement the JSON-exporting you mention outside of the PDF.js library as well, since as outlined above it's possible to access the "raw" data for modified Annotations.

@jaime-rivas
Copy link
Author

Thank you @Snuffleupagus!

We will work on an external library to access AnnotationStorage and exporting the annotations. We will keep this issue updated when we make progress.

@Snuffleupagus
Copy link
Collaborator

Let's close this as WONTFIX for now, for the reasons outlined in #15055 (comment).

@Snuffleupagus Snuffleupagus closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@timvandermeij @Snuffleupagus @jaime-rivas and others