On Mon, 6 Sep 2010, Vnpenguin wrote:

Hi,
I have a multi-page PDF without page number . Is there simple way to
insert page number by using ConTeXt ?
I'm thinking about:
 * Setup ConTeXt with zero or small margins,
 * Setup page number (possibility to start from some value, not
necessary from 1)
 * Include each page of PDF as picture
 * Build PDF with ConTeXt

but I can not found an example for that.

Any ideas for help?

Using layers will be an easier option.

You can abuse the cut-n-paste module (http://github.com/adityam/cut-n-paste) to add pagenumbers in an easy way.

\definenumber[whatever]

\unexpanded\def\PAGENUMBER%
  {\incrementnumber[whatever]%
   \getnumber[whatever]}

\usemodule[cut-n-paste]


\starttext
\processcutNpaste
  [%option=test,
   text={Page~\PAGENUMBER},
   location={(OverlayWidth/2, 1cm)},
   name=file]
\stoptext

Here name=<filename> that you want to include.

The text is placed by metapost, so the location parameter must be some dimension that metapost understands, and the lowerleft corner is origin. Uncomment option=test to get a grid to measure stuff.

If you have to include many pdf files, you can do

\defincutNpaste[PageNumber][...] %options

\processPageNumber[name=file1]
\processPageNumber[name=file2]

etc.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to