Hello,

this is just an announcement and maybe a proposal.

I needed to copy all pages from a .pdf file into the document.

The pages to be copied were a mix of A4 and A3 pages, with portrait and 
landscape orientation.

Also, I needed to suppress current header & footer and to use the whole page 
area, like with \setuplayout[page].

I tried various combination of \filterpages, \copypages and \externalfigure - 
nothing the the whole desired effect.

Finally, I created the following snippet:

----
\startluacode
  function copyPages(fn)
    local fig = figures.push{name = fn}

    figures.identify()
    figures.check()

    local n = fig.used.pages

    figures.pop()

    for i = 1, n do
      context.startTEXpage()
        context.externalfigure({fn}, {page = i})
      context.stopTEXpage()
    end
  end
\stopluacode

\starttext
  %\externalfigure[tt.pdf][page=3]

  \directlua{copyPages("tt.pdf")}
\stoptext
----

It seems to work;

but it might be better to add an option to an existing command, e.g. \copypages (e.g. 
"preservecurrentpagesize" and/or "autosize" and/or "fullpage") to achieve the 
same effect.

Best regards,

Lukas

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

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

Attachment: T.mkiv
Description: Binary data

___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to