[NTG-context] including pdf

Aditya Mahajan adityam at umich.edu
Wed Feb 2 17:37:47 CET 2011


On Wed, 2 Feb 2011, Andrea Valle wrote:

> Ok, let's reformulate partially
>
> If I have:
>
> \setuppapersize[A4]
>
> \setuppagenumbering[location=left, state=start]
>
> \starttext
>
> \copypages[pdf/Test.pdf][scale=1000]
>
> \stoptext
>
> Looking at the resulting pdf, it seems that the original pdf is mirrored 
> (apart from half a line at the bottom of the paper, trunked).
> Ok. But there are not page numbers (I guess they are coverd by the imported 
> pdf)

You can add a layer on top and set page numbers in the layer.

> Now, so sum up my problem is:
> - given a certain number of A4 pdf
> - how to collect them in a unique pdf
> - with successive page numbers
> - and with refs, so that I can automagically create a TOC

For a quick solution, you can try the cut-n-paste module[1]. It does not 
create a TOC, so you will have to do that by hand (or a helper macro).

\usemodule[cut-n-paste]

\newcount\colledpages

\definecutNpaste[collection][n=1,text={\setups[page]},location=(OverlayWidth/2,1cm)]

\startsetups[page]
   \doglobal\increment{\collectedpages}%
   \collectedpages
\stopsetups

\starttext

\processcollection[name=paper1.pdf]
\processcollection[name=paper2.pdf]
\processcollection[name=paper3.pdf]

\stoptext

The location of the text is controled by the location key. This can be any 
valid metapost coordinate.

The module is actually meant for convert two column pdfs to one column 
pdfs (for reading on an ebook device), so it an overkill for just merging 
pages. You can however control how many pages to insert, (using start and 
stop keys), and draw a grid on the page (grid=yes), and trim the page 
(more complicated).

But, as I said earlier, the simplest way is to just insert the page number 
in a layer.

Aditya

[1]:https://github.com/adityam/cut-n-paste



More information about the ntg-context mailing list