* Insert page number into multi-page PDF
@ 2010-09-06 21:11 Vnpenguin
2010-09-06 22:00 ` Hans Hagen
2010-09-06 22:11 ` Aditya Mahajan
0 siblings, 2 replies; 6+ messages in thread
From: Vnpenguin @ 2010-09-06 21:11 UTC (permalink / raw)
To: ConTeXt list
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
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Insert page number into multi-page PDF
2010-09-06 21:11 Insert page number into multi-page PDF Vnpenguin
@ 2010-09-06 22:00 ` Hans Hagen
2010-09-07 16:40 ` Vnpenguin
2010-09-06 22:11 ` Aditya Mahajan
1 sibling, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2010-09-06 22:00 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Insert page number into multi-page PDF
2010-09-06 22:00 ` Hans Hagen
@ 2010-09-07 16:40 ` Vnpenguin
2010-09-07 16:52 ` Wolfgang Schuster
0 siblings, 1 reply; 6+ messages in thread
From: Vnpenguin @ 2010-09-07 16:40 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Tue, Sep 7, 2010 at 00:00, Hans Hagen <pragma@wxs.nl> 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 ?
Thanks
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Insert page number into multi-page PDF
2010-09-07 16:40 ` Vnpenguin
@ 2010-09-07 16:52 ` Wolfgang Schuster
2010-09-07 17:49 ` Vnpenguin
0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2010-09-07 16:52 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 07.09.2010 um 18:40 schrieb Vnpenguin:
> On Tue, Sep 7, 2010 at 00:00, Hans Hagen <pragma@wxs.nl> 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
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Insert page number into multi-page PDF
2010-09-07 16:52 ` Wolfgang Schuster
@ 2010-09-07 17:49 ` Vnpenguin
0 siblings, 0 replies; 6+ messages in thread
From: Vnpenguin @ 2010-09-07 17:49 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Tue, Sep 7, 2010 at 18:52, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:
>
> Am 07.09.2010 um 18:40 schrieb Vnpenguin:
>
>> On Tue, Sep 7, 2010 at 00:00, Hans Hagen <pragma@wxs.nl> 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,
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Insert page number into multi-page PDF
2010-09-06 21:11 Insert page number into multi-page PDF Vnpenguin
2010-09-06 22:00 ` Hans Hagen
@ 2010-09-06 22:11 ` Aditya Mahajan
1 sibling, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2010-09-06 22:11 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-09-07 17:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-06 21:11 Insert page number into multi-page PDF Vnpenguin
2010-09-06 22:00 ` Hans Hagen
2010-09-07 16:40 ` Vnpenguin
2010-09-07 16:52 ` Wolfgang Schuster
2010-09-07 17:49 ` Vnpenguin
2010-09-06 22:11 ` Aditya Mahajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).