https://github.com/cako/pdfnoter
Annotate PDFs from a text file containing the notes.
https://github.com/cako/pdfnoter
Last synced: 8 months ago
JSON representation
Annotate PDFs from a text file containing the notes.
- Host: GitHub
- URL: https://github.com/cako/pdfnoter
- Owner: cako
- Created: 2011-08-09T01:48:22.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-08-12T02:34:02.000Z (almost 15 years ago)
- Last Synced: 2023-03-12T09:41:55.995Z (over 3 years ago)
- Language: Perl
- Homepage:
- Size: 262 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
README
======
Introduction
------------
Annotating PDF files is hard. There are a few
options, but none of them are good enough for the
technically inclined. Most PDF annotators use either
ASCII text or free form tools.
The question arises: How does one annotate a PDF
with LaTeX notation. The answer is, you simply
don't.
This little script might be the beginning of a
positive answer. The idea of the solution is to
create another PDF with the annotations, then
"stamp" it on the original PDF one needs to
annotate.
The manual process was first described on [this
blog](http://3diagramsperpage.wordpress.com/2011/07/29/mathematical-annotations-in-pdf-documents/).
After the author contacted me, I took it upon myself
to automate the process a bit, and the results so far include this script and my
other project, [annotate-pdf](https://github.com/cako/annotate_pdf). Hopefully,
I won't stop here, and will find even better ways to quickly annotate PDFs.
The idea is to eventually embed this type of annotation in popular PDF readers,
or even write another PDF reader dedicated to annotations.
Requirements
------------
* [perl](http://www.perl.org/get.html)
* [pdftk](http://www.pdflabs.com/docs/install-pdftk/)
* [pdfinfo](http://www.foolabs.com/xpdf/) (part of the xpdf utilities for PDF files)
* pdflatex
* textpos package for LaTeX
Installation
------------
The tricky part here is the installation of the requirements, and not the program itself.
### Ubuntu
sudo apt-get install perl pdftk poppler-utils texlive-latex-extra
### Windows
Download Strawberry Perl [here](http://strawberryperl.com/) and install it.
Download `pdftk` [here](http://strawberryperl.com/). To install it, copy
the two files (a `.exe` and a `.dll`) to the
`C:\WINDOWS\system32\` folder.
Download `pdfinfo` from
[here](http://www.foolabs.com/xpdf/download.html),
and copy `pdfinfo.exe` to the `C:\WINDOWS\system32\` folder.
Finally, install a LaTeX distribution such as
[MiKTeX](http://miktex.org/2.9/setup) if you
don't already have one.
Instructions
------------
Write your notes in a text file, following the format specified in the
`example.tex` example file. (The format is super simple,
[check it out](https://github.com/cako/pdfnoter/blob/master/example.tex)!)
Then run
perl pdfnoter.pl INPUT_PDF INPUT_NOTES
You are done! The annotated file is produced on the same folder as the
`INPUT_NOTES` file.
Example
-------
The simplest note is this one:
1, 5cm, 1cm, 2cm
This as complicated as notes get!
It produces a 5cm wide container, 1cm from the left and 2cm from the top of page 1.
Another note, found in [example.tex](https://github.com/cako/pdfnoter/blob/master/example.tex)
produces the following PDF given the background *lorem ipsum* dummy PDF.
![Looks good to me!][img1_45]
[img1]: http://i.imgur.com/58pDA.png
[img1_45]: http://i.imgur.com/Bhp3O.png
To Do
----
* Create `.exe` for Windows with bundled programs (and their sources!)
* Allow comments
Please Contribute!
------------------
This code is licensed under the GNU General Public
License version 3. Go ahead, fork it and improve it!