[NTG-context] Replacing a piece of a paper

Procházka Lukáš Ing. - Pontex s. r. o. LPr at pontex.cz
Wed Jan 12 09:39:03 CET 2011


Hello,

thanks to all for the answers, Peter's solution is closest to that I need. My code now is:

---
\setuppapersize[A1,landscape]
\setuplayout[page]
\setuppositioning
   [state=overlay,
    yoffset=-12pt % Why?
   ]

\starttext
   \startpositioning
     \position(0,0){\rotate[rotation=90]{\externalfigure[TvNK]}}
     \position(630mm,297mm){\framed[frame=off,offset=overlay,background=color,backgroundcolor=white]
                           {\externalfigure[_R]}}
   \stoppositioning
\stoptext
---

I'd still have two questions:

- Is it possible to determine the size of the PDF being inserted (in my case the "TvNK", which is A1)? I'd need to know this because depending on this, I'd need to \setuppapersize[<size-of-PDF-to-be-inserted>,landscape].

- Is it possible to "move" the origin for \positioning to the right bottom corner? It's not "fatal" to know it, as having the PDF size known, I can evaluate 630mm = width.of.A1 - width.of.A4 and 297 = height.of.A1 - height.of.A4;  I'm just curious.

Best regards,

Lukas


On Tue, 11 Jan 2011 21:32:12 +0100, Peter Münster <pmlists at free.fr> wrote:

> Not necessary, context can produce such files for you.
>
> Example, using positioning macros, that shows also a problem with
> vertical offset:
>
> --8<---------------cut here---------------start------------->8---
> % Produce A2-example:
> \startbuffer[a2]
> \setuppapersize[A2]
> \setuplayout[page]
> \setupbackgrounds[page][background=color, backgroundcolor=blue]
> \starttext
> \input tufte
> \stoptext
> \stopbuffer
> \savebuffer[a2][a2-page.tex]
> \executesystemcommand{context a2-page}
>
> % Produce A4-example:
> \startbuffer[a4]
> \setuppapersize[A4]
> \setuplayout[page]
> \starttext
> \input tufte
> \stoptext
> \stopbuffer
> \savebuffer[a4][a4-page.tex]
> \executesystemcommand{context a4-page}
>
> % Do the job:
> \setuppapersize[A2]
> \setuplayout[page]
> \setuppositioning[state=overlay,
>   yoffset=-12pt%%%%%%%%%%%%%%%%%%%%%%% Why is this offset needed???
> ]
> \starttext
> \startpositioning
>   \position(0,0){\externalfigure[a2-page]}
>   \position(0,0){\framed[frame=off, offset=overlay, background=color,
>       backgroundcolor=white]{\externalfigure[a4-page]}}
> \stoppositioning
> \stoptext
> --8<---------------cut here---------------end--------------->8---
>


-- 
Ing. Lukáš Procházka [mailto:LPr at pontex.cz]
Pontex s. r. o.      [mailto:pontex at pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038



More information about the ntg-context mailing list