org-noter icon indicating copy to clipboard operation
org-noter copied to clipboard

Export notes from org to pdf annotations

Open ghost opened this issue 7 years ago • 12 comments
trafficstars

I'm a new org-noter user, and really enjoying it so far. I like writing the localized notes in org mode corresponding to various locations in the PDF.

On the other hand, I don't want to be stuck in org either -- I'd love to automatically insert my notes as annotations into the appropriate location in the PDF. This would be especially useful for when I want to annotate a PDF and review it on another device, or share it with somebody else.

Is there any chance this would be possible? I'd love to hear your thoughts. Thanks!

ghost avatar Jun 17 '18 05:06 ghost

Yes, I think this should be possible with pdf-tools, as it has a way to add annotations to the PDF.

The only problem would be that all things related to org-mode (inline latex, babel...) would stop working, as you probably expect!

Also, this probably should create a new PDF instead of modifying the original, no?

weirdNox avatar Jun 18 '18 14:06 weirdNox

Modifying in-place vs making a new document might be a customization variable.

ghost avatar Jun 18 '18 19:06 ghost

There is another workflow that I think would be very cool, but might be too different from the org-noter vision (I'm not sure):

I'd like to modify the annotations in place, live, so that when I open the PDF in another application, the annotations are all visible and editable. I could take notes in an org buffer, then move to a tablet PDF reader and edit the notes, then continue editing them in org later.

Perhaps the annotations in the PDF could be combined in a single notes window as indirect buffers. This could then be exported if desired into a standalone org file. Multifiles might be a useful tool here.

ghost avatar Jun 18 '18 19:06 ghost

Hm... these last days I was thinking about this and thought about 2 potential problems:

  • How would we associate the notes with each annotation? The second time we export we would need a way to know which notes were created, deleted or updated in order to keep the document from having duplicate annotations
  • After exporting, we would lose the hierarchy of the notes, so I don't really know a way to import it from the annotations... it would be flattened which is probably not what we want.

Maybe with some markup we could workaround these issues... Like having a property on the notes which says which notes were already updated and to which annotations IDs, and on the document we could add some information to the annotations that would relate them to the notes.

weirdNox avatar Jun 20 '18 11:06 weirdNox

I like the idea of two way synchronizing, but it's tricky to do it right, especially when the annotation extraction is not reliable enough -- sometimes only part of the highlighted text is extracted. I think a simpler approach is to keep all your annotations in your notes file and keep both your PDF documents and notes in your Dropbox and synchronize it everywhere. It takes no effort to open my PDF to get to my notes and vice versa. Correct me if I'm wrong!

et2010 avatar Jun 20 '18 12:06 et2010

@et2010, I agree that synchronizing both things is trivial and it is what I do (I have notes files that are associated with 70 PDFs each, and everything is kept in sync with Syncthing). However, I must admit that I always use my desktop or laptop to work, so I never use a tablet or phone to see anything. I can see why it may be useful to insert the notes into the PDF and edit them there.

sometimes only part of the highlighted text is extracted

I don't think the suggestion was in relation to highlights but more about text notes (@apnewberry, is this correct?). I think he suggested that the notes should be exported to the PDF as those "post-it" annotations, and then he would be able to edit them with a usual PDF viewer.

I think the idea is great, with some non-trivial implementation details. Nevertheless, I probably will give priority to #15 as it is something I will use more.

weirdNox avatar Jun 20 '18 14:06 weirdNox

I don't think the suggestion was in relation to highlights but more about text notes (@apnewberry, is this correct?). I think he suggested that the notes should be exported to the PDF as those "post-it" annotations, and then he would be able to edit them with a usual PDF viewer.

Exactly right.

ghost avatar Jun 20 '18 17:06 ghost

PDFs can have files embedded (attached). One way to deal with the two-way sync issues is to export the notes for this PDF and attach them in some Org-noter desired format. Then also embed the notes as traditional PDF markup. If you want to sync changes made to the PDF elsewhere, you could extract all of the PDF markup, generate the Org noter file, diff this with the Org-noter that is attached, and then merge changes, or if there is a conflict, let the user deal with it using standard git/magit protocols for merging conflicts.

mankoff avatar Jun 26 '18 09:06 mankoff

Also, just one way Org Noter -> PDF would be very useful for sending marked-up PDFs to colleagues.

mankoff avatar Jun 26 '18 09:06 mankoff

Also, just one way Org Noter -> PDF would be very useful for sending marked-up PDFs to colleagues.

This would be a very useful addition and a good way to start tackling this issue.

igoralmeida avatar Apr 13 '20 19:04 igoralmeida

It seems it is a long term goal of https://github.com/fuxialexander/org-pdftools

Planed features: (Long-term) Org <-> PDF Annotation converter.

tdehaeze avatar Apr 16 '20 08:04 tdehaeze

One way Org Noter -> PDF is now in https://github.com/fuxialexander/org-pdftools/commit/a7915ddda3735aad0fd62a5b974da104943e94a2

fuxialexander avatar Apr 18 '20 07:04 fuxialexander