[pdftex] FreeText Annotations for pdf Document Concatenation with New Page Numbering

Frank Seaton Taylor goldenratio at mac.com
Sat Feb 9 03:14:08 CET 2002


Howdy folks.

Recently, I've been in charge of putting together a conference 
proceedings, and have run across the situation described so well in 
Bernhard Gramlich's comp.text.pdf posting included below, namely that of 
concatenating several pdf files not of my creation with the requirement 
that the concatenation has ordinary page numbering.

Through some trial and error I devised a method that I'm hoping you 
folks could help me automate. Let me explain my process. I get pdf files 
with prescribed margins and without page numbers from the submitters. 
Given the page counts for the submissions, I make a skeleton LaTeX 
document that produces a title page, table of contents, etc., and the 
appropriate number of pages which will later be replaced with the 
submissions. I make this document without page numbers as well. Now with 
Adobe Acrobat (not just the reader) I can replace the blank pages with 
submissions.

How do I get the page numbers in the final version you ask? Well here's 
my hack. I produced a pdf file of blank pages that is at least as long 
as my entire proceedings. With Acrobat I attach an annotation near the 
bottom of each page that gives the page number. (Not a pop-up 
annotation, but a constantly visible one---unless I'm mistaken a 
``FreeText'' annotation in pdf's parlance.) These annotations are 
outside the prescribed margins for the submissions so they don't 
interfere with the text of the submissions. From here it's just a bunch 
of ``Replace Pages...'' commands in Acrobat to get the finished product. 
Thi all works because Acrobat's annotations are (apparently) unaffected 
when the page to which they are attached is replaced.

More succinctly:

   1. Start with sufficiently many blank pages with page number 
annotations.
   2. Replace blank pages with the pdf of skeleton to get title page, 
table of contents, etc.
   3. Replace individual blank placeholders for submissions with the 
actual submissions.

Problems:

   1. Generating the page number annotations was tedious.
   2. The fact that independent processes make page numbers (Acrobat for 
the actual page numbers and LaTeX for the references) is error prone.
   3. I would like a more general capability so I could have running 
heads and feet.

I tried using pdflatex's \pdfannot to produce the page numbers as 
``FreeText'' annotations as part of my skeleton, but was unable to get 
it to work. (This is the first time I've written any pdf code and I've 
been digging through the pdf specification a lot, but I'm still a 
neophyte.) Code like:

   \pdfannot{/Subtype /FreeText /Rect [0 0 612 48] /Q 1 /Contents (Yadda, 
yadda, yadda...)}

produces a grey box in the right place on the page with a red question 
mark within, surely Acrobat's way of saying something is ill formed in 
my annotations. I believe I need some sort of /DA command to specify the 
font as well, but have been unable to get that to work.

No doubt one of you can point out a simple fix.

As a more lofty goal, I'd like to, probably via tricks similar to the 
above, generate the skeleton without page headers or footers being 
directly on the page, but rather with them as annotations in the exact 
position and font they would be in had they been directly on the page. 
(This collapses step 1 and 2 of my process and fixes all my problems.)

Is this possible?

Thank You,
---Frank

> From: gramlich at church.logic.tuwien.ac.at (Bernhard Gramlich)
> Newsgroups: comp.text.pdf
> Subject: pdf document concatenation with new page numbering?
> Date: 30 Mar 2001 08:57:32 GMT
> Organization: Technische UniversitM-dt Wien, Vienna, Austria
> Lines: 32
> Message-ID: <9a1hps$aj0$1 at news.tuwien.ac.at>
> Reply-To: gramlich at logic.at
> NNTP-Posting-Host: church.logic.tuwien.ac.at
> X-Newsreader: xrn 9.01
> To: gramlich at logic.at
>
>
> I'm wondering whether there are (easy, non-hack) solutions
> to the following (general) problem:
>
>   Given a couple of pdf documents d1.pdf, ..., dn.pdf (with
>   or without page numbering), create (automatically or almost
>   automatically) a single pdf document with a prescribed
>   (consistent) page numbering, preferably without modifying
>   the component pdf files.
>
> Are there any known solutions to this problem, in particular
> such ones, that work in batch mode in a shell (on unix/linux
> based systems) and only use freely available software?
>
> Since I just subscribed to comp.text.pdf, it may be the case
> that I've overlooked possible answers to this question in this
> newsgroup (though I didn't find any when quickly scanning the
> available messages). Apologies in that case!
>
> Yet, I'd be grateful for any hints (even in the latter case)!
>
> P.S.: Actually, the same kind of problem exists also for dvi
>       or ps instead of pdf, and I don't know of any satisfactory
>       solutions for these cases either.
>
>       On the other hand, the problem should be a very typical
>       (and often occurring) one, for instance, when collecting
>       (electronic) papers into one electronic proceedings volume!
>
> ========================================================================
>  Bernhard Gramlich             Vienna University of Technology
>  e-mail: gramlich at logic.at     www: http://www.logic.at/staff/gramlich
> ========================================================================




More information about the pdftex mailing list