I have two versions of the same PDF document. One has annotations that I did on it while reading it on my laptop, while the other has annotations that I did on a tablet. Now I want to merge these annotations into the same file.
I know that Adobe Acrobat allows me to do this (see for example this answer on Ask Different). Is there any software I can use in Ubuntu that will allow me to do this?
For what it is worth, I am using Xodo on the tablet.
At least
okular
stores comments as objects of/Type/Annot
, see these examples for the syntax:Those objects are linked to pages using a command like
/Annots 14 0 R
, which is how this script deletes all comments in a givenpdf
file, it simply deletes all the/Annots
lines:If you dive really deep into the structure of your specific
pdf
documents – just open them with a text editor –, you may be able to understand what's going on and manage to manipulate your documents with e. g.sed
, however I seriously doubt there exists a solution that fits every type ofpdf
document here. For what it's worth, (at least for my test file) the following oneliner gives you the comments ofinput.pdf
in a terminal:Add
>> comments
to the end of that line to store the output in a file namedcomments
instead.