politza / pdf-tools

Emacs support library for PDF files.
GNU General Public License v3.0
1.57k stars 162 forks source link

Highlights and annotations not saved #646

Closed faaip closed 2 years ago

faaip commented 3 years ago

When using this with doom emacs on macOS, my highlights and annotations are not saved. In Finder it says that the file has been modified, but the annotations and highlights aren't there when I reopen the file. By default pdf-tools opens the pdf in read-only, but I disable this and still it doesn't work. Any idea on why this might be? Thanks!

workcomplete commented 3 years ago

Having the same issue, this is new for me this week. I am using org-pdf-tools and thought it was be an issue with that package, but pdf-tools itself may be to common denominator.. #fuxialexander/org-pdftools#68. Also using DOOM.

Edit1: I don't think its an OS issue. I'm on Arch.

Edit2: Per my config pdfs open with pdf-tools-install already called for the buffer. As described by OP recalling it does not fix the problem. pdf-annot-minor-mode is active.

Edit3: all metadata from notes attached to annotations is intact for me (e.g. org-noter document links) it seems to be an issue with annotations themselves in the document buffer.

workcomplete commented 3 years ago

Cannot reproduce this now. Everything appears to be saving, but annotations are still missing from older documents.

Edit: this was most likely a user error for me. I was probably calling write from the notes buffer, which saved only my notes, not the linked annotations. I have org-noter open a new frame with a vertical split (notes on one side pdf on the other). I have to call write in the pdf buffer specifically for annotations to save.

vedang commented 3 years ago

Doom has now changed to point to my fork - vedang/pdf-tools - Please update your Doom and try again. As you've mentioned above, I believe this is not a bug. However, you don't need to call write in the pdf-buffer, simply selecting text and annotating it using C-c C-a h (or any other annotation function) should do the job.

faaip commented 3 years ago

@vedang . Tried updating doom, but still have this problem. Whenever I save the PDF buffer my annotations disappear. Do you have an idea for a solution?