# How to annotate PDF files generated by pdflatex?

I want to annotate some PDF files (created with pdflatex), e.g.

• word x is missing here
• this part of a sentence should be moved to the front
• replace word x by y
• highlight this sentence
• insert a note

etc.

The current Acrobat Reader has some annotation capabilities, but the PDF has to contain some magic bits that 'allow' annotations in the Adobe Reader. And by default PDFs created with pdflatex do not contain these bits. Is there is a workaround available?

Adobe Acrobat does not need this permissions - but it do not have a license and the current version probably does not work on all systems I use.

Okular has some annotation features, but the annotations are not saved in the PDF - pretty useless for me, because I want to exchange these annotations.

Thus, what are the alternatives for annotating PDF files generated by pdflatex?

Basic requirements:

• open source
• run at least on Linux
• Annotations should be saved in the PDF file
• Annotations should be viewable with standard PDF viewers (e.g. Acrobat Reader)
• It would be nice if a PDF viewer could skip from annotation to annotation and display them with color marks at the scrollbar (like compile errors/warnings in an IDE)

Edit: After some answers - it seems that there are 3 feasible routes to solve the annotation problem:

1. An open source PDF-tool that implements the PDF annotation specification (looks like there is some WIP)
2. A tool that patches the PDF file (i.e. adds some kind of signature), such that the reviewer can just use some Acrobat Reader Version > 5.0 (not available AFAIK, not open source)
3. If the .tex-source is available and the reviewer knows LaTeX she can just use the pdfcomment package
-
What are the magic bits? It seems the simplest solution would be to pdflatex (perhaps with the hyperref package?) to write those bits to the pdf file. – Matthew Leingang Dec 1 '10 at 12:58
Well, I don't really know - I guess it is some DRM-like signature. Googled some time ago for it - but could not find exact informations about it ... – maxschlepzig Dec 1 '10 at 13:08
Old (but not necessarily out of date) information here. – Matthew Leingang Dec 1 '10 at 13:46
There's always the pencil-and-paper approach... – SamB Dec 17 '10 at 0:15
Sure, but the point of using PDF annotations really is to be able to conveniently exchange them, e.g. send the result to people via email - or email the PDF to a reviewer and get the annotated document back via email. Very convenient - if it works. – maxschlepzig Feb 13 '11 at 9:57
show 1 more comment

I've been using flpsed (http://www.ecademix.com/JohannesHofmann/flpsed.html) to comment text in PDFs for years, easy, fast, slim.

-

Okay jumping on the old horse! ;-)

Meanwhile Acrobat Reader X offers some simple possibilities for PDF annotations. If you want to do more you can use the pdfcomment package, e.g. for your examples:

\documentclass[a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[rgb]{xcolor}
\usepackage[author={Max Schlepzig}]{pdfcomment}
\begin{document}
Here we\pdfcomment[color=red,icon=Insert]{insert: miss} a word!

You can do much more \pdfmarkupcomment[markup=Squiggly,color=green]{with pdfcomment}{move to the front}.

This is a \pdfmarkupcomment[markup=StrikeOut,color=red]{stupid}{replace stupid with funny}  game!

\pdfmarkupcomment[markup=Highlight,color=yellow]{Of course, you can highlight complete sentences.}{Highlight}

This is very\pdfcomment[icon=Note,color=blue]{insert graphic!} interesting!
\end{document}


-
great to discover the pdfcomment package! looks nice. – jfbu Apr 30 '11 at 21:42
good hint about pdfcomment - if you have the source available and the editor knows LaTeX, then this is a good option. – maxschlepzig May 6 '11 at 20:24
I have been working with the author of pdfcomment (because I have been working on a similar tool, which is now in the more-or-less deprecated pdfmarginpar package). My most recent knowledge about the state-of-the-art is that TeX will successfully generate annotations, and you can see them and move the popups. But you CANNOT EDIT them. They are purely read-only. I believe there is no way around this limitation because it would involve some sort of key encryption (I do not know the details). – Christian Feuersänger May 7 '11 at 10:44
@Christian Feuersänger I think maxschlepzig is talking about journal editors. You can edit PDF annotations if your reader does support it. Adobe Raeder X now has support for PDF text annotations and Highlight markup annotations and can edit them. Other viewers don't have to edit the PDF file itself they simply can write a new PDF file, like Foxit or X-Change viewer are doing. So editing is no problem if supported by the viewer the one way or the other. In the context of LaTeX it makes more sense to edit the LaTeX source anyway. Put it into a SVN repository and all work with the same document. – Josef May 7 '11 at 12:32
thank you for the note. – Christian Feuersänger May 10 '11 at 20:48

As it doesn't seem to have been mentioned, what about the pdfcomment Latex package?

It will write pdf annotations (note that here you would write the annotations as Latex code - however, under Linux the pdf annotations would be only viewable in Adobe Reader - although evince seems to start at least showing icons in the 11.04 Ubuntu...)

EDIT: Imagine, I didn't know this by now :) Check evince annotiations - Ubuntu Forums and Re: [evince] Annotation and evince - actually, evince does support both adding and reading PDF annotations; and I'm having evince version "GNOME Document Viewer 2.32.0" and "libpoppler13/natty uptodate 0.16.4-0ubuntu1" (i.e. I'm not even sure I'm having the recommended poppler 0.15 on Natty?).... Though, note you need to use the dropdown menu in sidebar to get a list of annotations and adding - and for some reason, annotations added through evince itself are clickable (and their contents can be read) - those from pdfcomment aren't (and their contents are not shown in the list).

-
And in this post: [[pdftex] pdf objects with references to each other?](tug.org/pipermail/pdftex/2002-March/002440.html) there is direct pdftex code that can make the annotation clickable in evince... – sdaau Apr 30 '11 at 13:08
... and here is a small hack to pdfcomment.sty which will make the annotations clickable in evince: A slight change: pdfcomment annot. for Evince – sdaau Apr 30 '11 at 13:48
In the case you don't monitor the forum: i wrote a reply ;-) – Josef Apr 30 '11 at 20:16
@Josef - sorry, just wanted to document the pdfcomment/evince trick :) Cheers! – sdaau May 1 '11 at 16:28
The link above seems to be dead (november 2012). My Evince doesn't properly detect the pdfannotations ; however, okular does anyway. – rcabane Nov 14 '12 at 8:15
show 1 more comment

There seem to be several pdf readers for Windows that allow you to add annotation to pdf documents, however, there does not seem to be anything like that for Linux, apart from PDFedit, which, in my experience, is rather hard to use and at the moment very unstable.

One Linux tool that couild be at least partially helpful is flpsed. it is a tool for adding annotation to Postscript files, and it can (to some extent) handle pdf files through external programs. I used it before to fill in pdf forms that were not "fillable".

-
 I tried pdfedit yesterday, and indeed, I found it hard to use ;) – maxschlepzig Dec 2 '10 at 10:11 +1 for suggesting flpsed – Ken Bloom May 3 '11 at 17:44

Using wine you can install and run pdf-xchange. As far as I recall it is free and worked fine for me under linux. Should do the things you want.

-
+1 for pdf-xchange viewer. After trying every tool available on Linux, at the end I came to this app. Works fine through wine, at least versions prior to the last one. – Meho R. Dec 1 '10 at 22:55
Foxit Phantom also works through wine and, at least on my machine, works smoother than pdf-xchange viewer and faster. Only trouble is that I could only get version 2.2.4.0225 to work, but not newer. – Roey Angel Oct 30 '12 at 11:24

I use xournal and jarnal for this sort of thing. I've no idea how they compare to Adobe and I almost never use Adobe, and I don't know if "annotations" has a special meaning in the context of this question so these might not be what you're looking for.

1. Both are open source (xournal is a C++ program, jarnal is java)
2. Both run on Linux (jarnal runs on any platform with java)
3. Both can export to PDF
4. Given that both can export to PDF, if "annotations" has no special connotations, this is certainly true