TransWikia.com

How to annotate PDF files generated by pdflatex?

TeX - LaTeX Asked on August 12, 2020

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

10 Answers

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

Answered by Timtico on August 12, 2020

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

Answered by Andrew Stacey on August 12, 2020

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.

Answered by Dror on August 12, 2020

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

Answered by Jan Hlavacek on August 12, 2020

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

Answered by sdaau on August 12, 2020

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 wepdfcomment[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 verypdfcomment[icon=Note,color=blue]{insert graphic!} interesting!
end{document}

enter image description here

Answered by Josef on August 12, 2020

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.

Answered by Keks Dose on August 12, 2020

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.

Answered by Andrestand on August 12, 2020

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]{...

Answered by bluesceada on August 12, 2020

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.

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.

Answered by user570286 on August 12, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP