elias-sundqvist / obsidian-annotator

A plugin for reading and annotating PDFs and EPUBs in obsidian.
GNU Affero General Public License v3.0
1.46k stars 68 forks source link

[feature request] add existing highlights and annotations #139

Open cs-mshah opened 2 years ago

cs-mshah commented 2 years ago

I already have several highlights made by external pdf applications like ocular. These annotations are being detected by the pdf viewer used by this plugin. I wanted a way to add the existing annotations to markdown instead of having to repeat the process.

image

As you can see, the highlights' metadata is being detected upon clicking the highlights. What can be done is add 2 options -

I would love to see this feature being added

ryanwwest commented 2 years ago

I'd love to see this too, and also for epubs. It seems that one could parse PDFs somehow to identify where each highlight begins and ends, then add the markdown json that stores the hypothes.is annotations and use the same start and end locations. Some problems might be that I'm not sure if different PDF annotator programs edit the PDF in different ways to put in highlights / notes; if so, it might be hard to support them all.

Furthermore, it might be nice to automatically remove the external pdf annotations once they have been imported (also to possibly restore the pdf fingerprint of the original document). But this isn't as important.

chrisaldrich commented 2 years ago

The work to add this particular feature to the plugin may be quite a lot, but for those who want it in the erstwhile and for the developers as an example, one might try looking at https://forum.obsidian.md/t/zotero-zotfile-mdnotes-obsidian-dataview-workflow/15536.

ryanwwest commented 1 year ago

What @chrisaldrich mentions is interesting but doesn't focus on obsidian-annotator directly. I do enjoy using Zotero with Obsidian and this plugin, however, and keep my folder of Zotero attachments/documents within my vault so I can open the PDFs in either PDF viewer (Zotero 6 or obsidian-annotator).

Since Zotero already supports converting annotations/highlights from various external standards (I believe) to or from their own embedded version, I wonder if it would make this a simpler task to just be able to convert from Zotero's format of annotations to obsidian-annotator's JSON-Markdown representation.

Then later, more complex and more functional would be two-way syncing between Zotero's annotation database for a document and your Markdown note - but even then I think that would be less complicated than supporting arbitrary existing annotation standards.