[NTG-context] including pdf and using the entire page

2007-02-04 Thread Johan Sandblom
In my document I want to include a few published pdf files. I have
accomplished this with

\chapter{File 1}
\copypages[file1.pdf][scale=800] % 20 pages
\chapter{File 2}
\copypages[file1.pdf][scale=650] % 16 pages

However, the included pages obey the layout of the rest of the
document, and even if the paper in my document could allow a larger
scale, I cannot use it since some part of the included file falls off
the page.

Is it possible to include pdf files and allow each page to use the
entire page (possibly with room left for a page number)?

I have tried several versions including using makeup (but that is only
one page?), pagefigure (also only one page at a time).

Regards, Johan

-- 
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
What is wanted is not the will to believe, but the
will to find out, which is the exact opposite
- Bertrand Russell
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] including pdf and using the entire page

2007-02-04 Thread Aditya Mahajan
On Sun, 4 Feb 2007, Johan Sandblom wrote:

 In my document I want to include a few published pdf files. I have
 accomplished this with

 \chapter{File 1}
 \copypages[file1.pdf][scale=800] % 20 pages
 \chapter{File 2}
 \copypages[file1.pdf][scale=650] % 16 pages

 However, the included pages obey the layout of the rest of the
 document, and even if the paper in my document could allow a larger
 scale, I cannot use it since some part of the included file falls off
 the page.

Try without any value for scale, that is just \copypages[file1.pdf].


 Is it possible to include pdf files and allow each page to use the
 entire page (possibly with room left for a page number)?

See below.

 I have tried several versions including using makeup (but that is only
 one page?), pagefigure (also only one page at a time).

Basically you need to find out the number of pages of the file and 
then recursively include them one by one.

Recently, I wanted to print a collection of papers as a single pdf, 
with its own table of contents etc. The trouble was that some of the 
papers were printed on A4 paper and some were on letter paper. So, I 
modified the copypages macro to suit my needs. There is very little 
configuration options for the macro, it behaves the way I wanted it 
to. Maybe, you can modify it to your needs.

\unprotect

%D Usage \copyfullpages[filename.pdf]

\def\copyfullpages
   {\dodoubleempty\docopyfullpages}

\def\docopyfullpages[#1][#2]%
   {\bgroup
\getfiguredimensions[#1]%
\getparameters[\??ip]
  [\c!n=\noffigurepages,
   \c!marking=\v!off,
   \c!scale=\!!thousand,
   \c!offset=\!!zeropoint,
   #2]%
\dorecurse\@@ipn

{\startTEXpage[\c!width=\paperwidth,\c!height=\paperheight,\c!offset=\@@ipoffset]
\externalfigure
 [#1]

[\c!page=\recurselevel,\c!width=\paperwidth,\c!height=\paperheight,\c!factor=\v!max,#2]
 \stopTEXpage
\incrementnumber[page]}
\egroup}

\protect

For page numbers, I had a separate layer, which printed on top of the 
included pdfs (some pdfs were scanned images). I can send you my 
module if you want.

Aditya
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] including pdf and using the entire page

2007-02-04 Thread Johan Sandblom
Thank you, now I have something to play with! And yes, please, I would
very much like to look at you module.

Johan

2007/2/4, Aditya Mahajan [EMAIL PROTECTED]:
 On Sun, 4 Feb 2007, Johan Sandblom wrote:

  In my document I want to include a few published pdf files. I have
  accomplished this with
 
  \chapter{File 1}
  \copypages[file1.pdf][scale=800] % 20 pages
  \chapter{File 2}
  \copypages[file1.pdf][scale=650] % 16 pages
 
  However, the included pages obey the layout of the rest of the
  document, and even if the paper in my document could allow a larger
  scale, I cannot use it since some part of the included file falls off
  the page.

 Try without any value for scale, that is just \copypages[file1.pdf].


  Is it possible to include pdf files and allow each page to use the
  entire page (possibly with room left for a page number)?

 See below.

  I have tried several versions including using makeup (but that is only
  one page?), pagefigure (also only one page at a time).

 Basically you need to find out the number of pages of the file and
 then recursively include them one by one.

 Recently, I wanted to print a collection of papers as a single pdf,
 with its own table of contents etc. The trouble was that some of the
 papers were printed on A4 paper and some were on letter paper. So, I
 modified the copypages macro to suit my needs. There is very little
 configuration options for the macro, it behaves the way I wanted it
 to. Maybe, you can modify it to your needs.

 \unprotect

 %D Usage \copyfullpages[filename.pdf]

 \def\copyfullpages
{\dodoubleempty\docopyfullpages}

 \def\docopyfullpages[#1][#2]%
{\bgroup
 \getfiguredimensions[#1]%
 \getparameters[\??ip]
   [\c!n=\noffigurepages,
\c!marking=\v!off,
\c!scale=\!!thousand,
\c!offset=\!!zeropoint,
#2]%
 \dorecurse\@@ipn

 {\startTEXpage[\c!width=\paperwidth,\c!height=\paperheight,\c!offset=\@@ipoffset]
 \externalfigure
  [#1]

 [\c!page=\recurselevel,\c!width=\paperwidth,\c!height=\paperheight,\c!factor=\v!max,#2]
  \stopTEXpage
 \incrementnumber[page]}
 \egroup}

 \protect

 For page numbers, I had a separate layer, which printed on top of the
 included pdfs (some pdfs were scanned images). I can send you my
 module if you want.

 Aditya
 ___
 ntg-context mailing list
 ntg-context@ntg.nl
 http://www.ntg.nl/mailman/listinfo/ntg-context



-- 
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
What is wanted is not the will to believe, but the
will to find out, which is the exact opposite
- Bertrand Russell
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context