100

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
9
  • 1
    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. Dec 1, 2010 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 ... Dec 1, 2010 at 13:08
  • 2
    Old (but not necessarily out of date) information here. Dec 1, 2010 at 13:46
  • 1
    There's always the pencil-and-paper approach...
    – SamB
    Dec 17, 2010 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. Feb 13, 2011 at 9:57

10 Answers 10

110

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}

enter image description here

7
  • 1
    great to discover the pdfcomment package! looks nice.
    – user4686
    Apr 30, 2011 at 21:42
  • good hint about pdfcomment - if you have the source available and the editor knows LaTeX, then this is a good option. May 6, 2011 at 20:24
  • 3
    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). May 7, 2011 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, 2011 at 12:32
  • 1
    Maybe a silly question: is there by any chance an easy way to generate PDF with pdfcomments comments, send it to someone, receive a version with replies to the comments, and importing these replies back to the latex source (and possibly replying to them again)? If not, this feature is only half that useful it could be! Feb 19, 2018 at 18:51
11

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).

6
  • 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, 2011 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, 2011 at 13:48
  • In the case you don't monitor the forum: i wrote a reply ;-)
    – Josef
    Apr 30, 2011 at 20:16
  • @Josef - sorry, just wanted to document the pdfcomment/evince trick :) Cheers!
    – sdaau
    May 1, 2011 at 16:28
  • 2
    The link above seems to be dead (november 2012). My Evince doesn't properly detect the pdfannotations ; however, okular does anyway.
    – rcabane
    Nov 14, 2012 at 8:15
9

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.

2
  • 1
    +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, 2010 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, 2012 at 11:24
6

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".

1
  • I tried pdfedit yesterday, and indeed, I found it hard to use ;) Dec 2, 2010 at 10:11
5

Okular since some time in 2014 can save annotations inside files by saving it to a new file with:

"File > Save as .."

The annotations will then be saved inside that new file, and not just in the configuration/system files of okular.

Opposite to that, you can use "File > Save Copy as ..", that removes any annotations for the newly saved file.

Unfortunately there is no way to check where the annotations are saved that you see in any opened pdf file. But if you generally save the pdf as a new file with "Save as .." before sending to anyone, you are on the safe side.

What helped for Acrobat Reader for me, was adding:

\pdfminorversion=4

before \documentclass[pdftex]{...

1
  • Welcome to TeX.SX! You can highlight code in your post using back-ticks. For code-blocks indent them by four spaces or use the {} on the gui.
    – user30471
    Jul 6, 2016 at 12:01
4

I think PDF edit is able to do what you want, it's open source, free etc. it can be found at http://pdfedit.petricek.net/en/download.html

4

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
  5. Don't know about this one
2
  • 1
    I think the OP is talking about "annotations" as in the comments or highlights one can make on a document in Word or Acrobat Pro. These are (cool) apps for handwriting notes from scratch. Dec 1, 2010 at 13:57
  • @Matthew: I wondered about that, but since "annotation" is an ordinary word which makes sense in this setting, I couldn't be sure. As I don't use Acrobat (Pro or otherwise) or Word, I have little conception of what extra features are involved with these "super annotations". Dec 1, 2010 at 19:16
1

If you want not just a marginpar box, but an object you can move in your viewer, another possible approach is to use attachfile package, with something like: \textattachfile[color=0 0 1,print=false]{empty}{\parbox{\linewidth}{$ \partial S \leq 0 $ is wrong!}}, maybe folded inside a marginpar or other thing to place it properly. It allows to use formulas, includegraphics', etc. though it is a very ugly method (you are attaching an empty file).

You can also use attachfile's {subject,description} options to make a meta-comment, or make it from the pdf viewer.

It would be nice not to have to attach that ghost file. I've looked for something to tailor a comment icon with pdfcomment but I haven't been able. attachfile provides a way to embed some extra icons in the pdf, making them not viewer-dependent, maybe that way. Also there is an option to avoid the ghost file (\notextattachfile, with print=true), but then the object is locked.

1

Five years later:

Under Windows, still pdf-xchange, but under Linux there is »Master PDF Editor«. With both you can add words, annotations, whatever to a PDF.


Old answer from 2012

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

0

Updated answer

MuPDF is an open-source PDF viewer for Linux, Windows, and Mac that supports creating PDF annotations. I don't have access to Adobe Reader currently to test, but at least the PDF viewers in Chromium and Google Drive are able to read annotations created with MuPDF.

Update 2: Another option I've tried now is Okular, KDE's PDF reader, which is open-source (of course) and can create annotations. Its graphical user interface is much less minimal than MuPDF's, but it feels sluggish to me and doesn't seem to support as many types of annotations as MuPDF (in particular, I see no option to attach a file to a PDF document).

Original not-quite-answer

Google Drive's PDF viewer supports adding "comments" on PDF files. Drive isn't open-source, but it's usable from Linux and the comments are saved to the file and, if the file is downloaded from Drive and opened in Adobe Acrobat, seem to show up as the same kind of annotations that Acrobat itself creates.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .