| 1 |
README for project pax (PDFAnnotExtractor) |
| 2 |
|
| 3 |
TABLE OF CONTENTS |
| 4 |
================= |
| 5 |
|
| 6 |
A. Project pax |
| 7 |
B. Copyright, License |
| 8 |
C. Files |
| 9 |
D. Author |
| 10 |
E. Requirements |
| 11 |
F. Download |
| 12 |
G. Installation |
| 13 |
H. Use |
| 14 |
I. History |
| 15 |
|
| 16 |
|
| 17 |
A. PROJECT PAX |
| 18 |
============== |
| 19 |
|
| 20 |
If PDF files are included using pdfTeX, PDF annotations |
| 21 |
are stripped. This project tries a solution without |
| 22 |
altering pdfTeX. A Java program (pax.jar) parses the PDF file that |
| 23 |
will later be included. It writes the data of the annotations |
| 24 |
in a file that can be read by TeX. Then a LaTeX package (pax.sty) |
| 25 |
extends the graphics package. If a PDF file is included, the package |
| 26 |
looks for the file with the annotation data, reads them and puts |
| 27 |
the annotations in the right place. |
| 28 |
|
| 29 |
Project status: experimental |
| 30 |
|
| 31 |
|
| 32 |
B. COPYRIGHT, LICENSE |
| 33 |
===================== |
| 34 |
|
| 35 |
Copyright (C) 2006-2008, 2011, 2012 Heiko Oberdiek. |
| 36 |
|
| 37 |
The project consists of two parts: |
| 38 |
* The Java program pax.jar with sources. |
| 39 |
The Perl wrapper pdfannotextractor.pl. |
| 40 |
License is GPL, see license/gpl.txt. |
| 41 |
* The LaTeX package pax.sty. |
| 42 |
License is LPPL 1.3. |
| 43 |
The file README belongs to both parts. |
| 44 |
|
| 45 |
The Java program uses the PDF library PDFBox, |
| 46 |
see http://pdfbox.apache.org/. |
| 47 |
|
| 48 |
|
| 49 |
C. FILES |
| 50 |
======== |
| 51 |
|
| 52 |
The project is available in CTAN (ftp.ctan.org): |
| 53 |
CTAN:macros/latex/contrib/pax/ |
| 54 |
|
| 55 |
There are the following files: |
| 56 |
* README |
| 57 |
This file. |
| 58 |
* pax.tds.zip |
| 59 |
The whole project, ready to unpack in a TDS (texmf) tree. |
| 60 |
|
| 61 |
The files inside pax.tds.zip: |
| 62 |
* doc/latex/pax/README |
| 63 |
This file. |
| 64 |
* scripts/pax/pax.jar |
| 65 |
The Java program. |
| 66 |
* scripts/pax/pdfannotextractor.pl |
| 67 |
Perl wrapper for calling the Java program in pax.jar. |
| 68 |
* source/latex/pax/license/LaTeX/lppl.txt |
| 69 |
License (LPPL) for the LaTeX package. |
| 70 |
* source/latex/pax/license/PDFAnnotExtractor/gpl.txt |
| 71 |
License (GPL) for the Java program. |
| 72 |
* source/latex/pax/src/Constants.java |
| 73 |
source/latex/pax/src/Entry.java |
| 74 |
source/latex/pax/src/EntryWriteException.java |
| 75 |
source/latex/pax/src/PDFAnnotExtractor.java |
| 76 |
source/latex/pax/src/StringVisitor.java |
| 77 |
Java source files. |
| 78 |
* source/latex/pax/src/MANIFEST.MF |
| 79 |
Manifest file for the JAR file. |
| 80 |
* source/latex/pax/src/build.xml |
| 81 |
Ant build file for generating the JAR file. |
| 82 |
* tex/latex/pax/pax.sty |
| 83 |
The LaTeX package. |
| 84 |
|
| 85 |
|
| 86 |
D. AUTHOR |
| 87 |
========= |
| 88 |
|
| 89 |
Heiko Oberdiek <heiko.oberdiek at googlemail.com> |
| 90 |
|
| 91 |
|
| 92 |
E. REQUIREMENTS |
| 93 |
=============== |
| 94 |
|
| 95 |
* Java 1.4+. |
| 96 |
* PDFBox 0.7.2 or 0.7.3. |
| 97 |
However, PDFAnnotExtractor does not work with the recent |
| 98 |
versions of PDFBox, currently only the older versions |
| 99 |
0.7.2 or 0.7.3 are supported. The older versions are |
| 100 |
available at SourceForge: |
| 101 |
http://sourceforge.net/project/showfiles.php?group_id=78314 |
| 102 |
* The Perl wrapper (optional) needs: |
| 103 |
* Perl |
| 104 |
* kpsewhich |
| 105 |
* java in PATH |
| 106 |
The option --install also requires: |
| 107 |
* wget or curl |
| 108 |
* unzip |
| 109 |
* texhash or mktexlsr |
| 110 |
|
| 111 |
|
| 112 |
F. DOWNLOAD |
| 113 |
=========== |
| 114 |
|
| 115 |
1. Download pax.tds.zip from CTAN: |
| 116 |
ftp://ftp.ctan.org/tex-archive/install/macros/latex/contrib/pax-tds.zip |
| 117 |
|
| 118 |
2. Download PDFBox-0.7.3.jar from http://www.pdfbox.org/ (22 MB) |
| 119 |
http://prdownloads.sourceforge.net/pdfbox/PDFBox-0.7.3.zip?download |
| 120 |
Or install PDFBox as RPM package or whatever. |
| 121 |
|
| 122 |
|
| 123 |
G. INSTALLATION |
| 124 |
=============== |
| 125 |
|
| 126 |
Examples are given for linux. |
| 127 |
|
| 128 |
3. Install PDFBox (from its home page, RPM package, ...). |
| 129 |
The wrapper pdfannotextractor.pl looks for the JAR file in directories: |
| 130 |
/usr/share/java/ |
| 131 |
/usr/local/share/java/ |
| 132 |
TDS:scripts/pax/lib/ (TDS:scripts//) |
| 133 |
assuming one of the following names: |
| 134 |
pdfbox.jar |
| 135 |
PDFBox.jar |
| 136 |
pdfbox-0.7.3.jar |
| 137 |
PDFBox-0.7.3.jar |
| 138 |
pdfbox-0.7.2.jar |
| 139 |
PDFBox-0.7.2.jar |
| 140 |
|
| 141 |
Alternative for 2. and 3. |
| 142 |
* Continue with 4. and 5.a). |
| 143 |
* Call `pdfannotextractor --install' (or with option --debug). |
| 144 |
It downloads PDFBox from its homepage and installs it |
| 145 |
in TEXMFVAR(VARTEXMF) below TDS:scripts/pax/ |
| 146 |
|
| 147 |
4. Unzip pax-tds.zip inside the TDS tree, where you want to put this |
| 148 |
project, e.g.: |
| 149 |
unzip pax-tds -d /usr/local/share/texmf |
| 150 |
Don't forget to update the database (texhash, mktexlsr, ...). |
| 151 |
|
| 152 |
5.a) Install the wrapper Perl script pdfannotextractor.pl |
| 153 |
as `pdfannotextractor' somewhere in your PATH (/usr/local/bin, |
| 154 |
/usr/bin, ...). |
| 155 |
5.b) Or write a wrapper script or whatever to ease the call of the |
| 156 |
Java program, e.g.: |
| 157 |
#!/bin/sh |
| 158 |
java -cp pax.jar:pdfbox.jar pax.PDFAnnotExtractor "$@" |
| 159 |
|
| 160 |
Version of PDFBox |
| 161 |
----------------- |
| 162 |
Developing the pax project I have used and tested version 0.7.2, |
| 163 |
also the current version 0.7.3 seems to be fine. Older versions |
| 164 |
are not supported at all, they may work or do not. |
| 165 |
|
| 166 |
|
| 167 |
H. USE |
| 168 |
====== |
| 169 |
|
| 170 |
As example I am using usrguide.pdf (with links from project latex-tds) |
| 171 |
that will be included in test.tex: |
| 172 |
|
| 173 |
%%% cut %%% test.tex %%% cut %%% |
| 174 |
\documentclass[a4paper,12pt,landscape]{article} |
| 175 |
\usepackage[ |
| 176 |
hmargin=1in, |
| 177 |
vmargin=1in, |
| 178 |
]{geometry} |
| 179 |
|
| 180 |
\usepackage{pdfpages} |
| 181 |
% pdfpages loads graphicx |
| 182 |
|
| 183 |
\usepackage{pax} |
| 184 |
|
| 185 |
\iffalse |
| 186 |
\usepackage{hyperref} |
| 187 |
\hypersetup{ |
| 188 |
filebordercolor={1 1 0}, |
| 189 |
} |
| 190 |
\fi |
| 191 |
|
| 192 |
\begin{document} |
| 193 |
\includepdf[pages=-,nup=2x1]{usrguide} |
| 194 |
\end{document} |
| 195 |
%%% cut %%% test.tex %%% cut %%% |
| 196 |
|
| 197 |
First run the Java program on usrguide.pdf: |
| 198 |
|
| 199 |
$ java -jar pax.jar usrguide.pdf |
| 200 |
|
| 201 |
It generates usrguide.pax. |
| 202 |
Next run pdflatex on test.tex twice at least: |
| 203 |
|
| 204 |
$ pdflatex test |
| 205 |
$ pdflatex test |
| 206 |
|
| 207 |
Then the links should work. |
| 208 |
|
| 209 |
Additionally package hyperref can be used (replace \iffase by \iftrue). |
| 210 |
Then the links can be configured using hyperref settings. |
| 211 |
(But keep in mind, the colored links by option colorlinks can't |
| 212 |
be changed in included documents. |
| 213 |
|
| 214 |
|
| 215 |
I. History |
| 216 |
========== |
| 217 |
|
| 218 |
2006/08/24 v0.1a |
| 219 |
* First release. |
| 220 |
2006/09/04 v0.1b |
| 221 |
* Bug fix in PDFAnnotExtractor.add_dest()/named destinations. |
| 222 |
2007/06/29 v0.1c |
| 223 |
* \l@addto@macro renamed to \PAX@l@addto@macro to avoid |
| 224 |
collision with classes of KOMA-Script. |
| 225 |
2007/06/30 v0.1d |
| 226 |
* Use of package `etexmcds'. |
| 227 |
2007/07/12 v0.1e |
| 228 |
* The Java program can be called with several files. |
| 229 |
2007/07/16 v0.1f |
| 230 |
* PDF files are explicitely closed to avoid warnings. |
| 231 |
2007/07/18 v0.1g |
| 232 |
* Compiled for Java 1.4. |
| 233 |
2007/07/19 v0.1h |
| 234 |
* JAR file without TDS tree. |
| 235 |
2008/10/01 v0.1i |
| 236 |
* Perl wrapper `pdfannotextractor.pl' added. |
| 237 |
* Section `Installation' from README rewritten. |
| 238 |
* Class-Path removed from MANIFEST.MF. |
| 239 |
2011/04/22 v0.1j |
| 240 |
* Update of email address and updating version dates |
| 241 |
for all files. |
| 242 |
2011/07/06 v0.1k |
| 243 |
* Package `pax' uses package `kvsetkeys' to avoid |
| 244 |
problems with incompatible `xkeyval'. |
| 245 |
2012/04/18 v0.1l |
| 246 |
* Option --version added to pdfannotextractor.pl. |
| 247 |
2022/06/07 v2022/06/07 |
| 248 |
* Port to recent pdfanotator |
| 249 |
* New developper Bastien Roucariès <rouca !at! debian.org> |