Insert page number into multi-page PDF
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? Thanks in advance, Regards
On 6-9-2010 11:11, 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?
\setuplayout[page] \copypages[yourfile.pdf][n=10] you can put stuff on top using the background mechanisms ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 07.09.2010 um 18:40 schrieb Vnpenguin:
On Tue, Sep 7, 2010 at 00:00, Hans Hagen
wrote: \setuplayout[page]
\copypages[yourfile.pdf][n=10]
you can put stuff on top using the background mechanisms
Could you give me an example about background mechanism ?
\defineoverlay [pagenumber] [\vbox to \paperheight {\blank[force,3cm] \midaligned{\pagenumber\ – \lastpagenumber} \vfill}] \setupbackgrounds[page][background={foreground,pagenumber}] \starttext ... \stoptext Wolfgang
On Tue, Sep 7, 2010 at 18:52, Wolfgang Schuster
Am 07.09.2010 um 18:40 schrieb Vnpenguin:
On Tue, Sep 7, 2010 at 00:00, Hans Hagen
wrote: \setuplayout[page]
\copypages[yourfile.pdf][n=10]
you can put stuff on top using the background mechanisms
Could you give me an example about background mechanism ?
\defineoverlay [pagenumber] [\vbox to \paperheight {\blank[force,3cm] \midaligned{\pagenumber\ – \lastpagenumber} \vfill}]
\setupbackgrounds[page][background={foreground,pagenumber}]
\starttext ... \stoptext
Wolfgang
Excellent, it works well. Thank you so much, Regards,
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
participants (4)
-
Aditya Mahajan
-
Hans Hagen
-
Vnpenguin
-
Wolfgang Schuster