5

I'm trying to merge a full size PDF page into my document and then to print the page number over the top in the normal position. I've read the page on the wiki about inserting PDF pages (http://wiki.contextgarden.net/Including_pages_from_PDF_documents).

Currently the code that I'm using is this:

\startTEXpage
\externalfigure[file.pdf][page=1]
\pagenumber
\setcounter[userpage][\pagenumber+1]
\stopTEXpage

This prints the right page number, but it is not in the right location. It also gives me a white bar across the bottom of the page. Can you help me change this code so that the page number is in the usual location, overlaying the imported PDF? The PDF should still fill the page.

I think that I need to use \externalfigure, rather than \copypages, \insertpages or \filterpages, because they don't fill the full A4 page in the way that \externalfigure does - which I want. When I say "fill" I mean that \externalfigure imports the whole PDF without any margins, footers or headers. However, if there is a way to stretch one of those other commands to fill the page then that may also work.

4

If you want the page number to appear above a pdf image which fills the entire paper area, you will have to put the image into the background. One way to achieve this would be a layer:

\definelayer 
  [fullpage] 
  [x=0mm, y=0mm, width=\paperwidth, height=\paperheight]
\setlayer [fullpage]
  [hoffset=0mm,voffset=0mm]
  {\externalfigure[file.pdf][height=\paperheight,page=1]}

\setupbackgrounds [paper] [background={fullpage,foreground}]

\starttext
   \null
\stoptext

Another possibility is the overlay mechanism:

\defineoverlay
  [fullpage]
  [{\externalfigure [file.pdf] [height=\paperheight,page=1]}]

\starttext

\setupbackgrounds [paper] [background={fullpage,foreground},state=start]
  \null
\stoptext

To switch it off, insert

\setupbackgrounds [paper] [background=]

at the top of the next page.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.