| 1 |
%% |
| 2 |
%% This is file `pdf-ex.tex', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% pdfpages.dtx (with options: `example1') |
| 8 |
%% |
| 9 |
%% This file demonstrates how to use the pdfpages package. |
| 10 |
%% |
| 11 |
%% Please send error reports and suggestions for improvements to |
| 12 |
%% Andreas MATTHIAS <[email protected]>. |
| 13 |
%% |
| 14 |
\documentclass[a4paper,12pt]{article} |
| 15 |
\usepackage[final]{pdfpages} |
| 16 |
\usepackage{verbatim} |
| 17 |
%% Uncomment the following lines, if you want to produce thumbnails. |
| 18 |
%%\usepackage{pdflscape} |
| 19 |
%%\usepackage{thumbpdf} |
| 20 |
|
| 21 |
\newcounter{example} |
| 22 |
\setcounter{example}{1} |
| 23 |
|
| 24 |
\newenvironment{example} |
| 25 |
{\par\vskip\topsep% |
| 26 |
\noindent\textbf{Example \arabic{example}:}% |
| 27 |
\stepcounter{example}% |
| 28 |
\par\vskip\topsep% |
| 29 |
\minipage{.9\linewidth}% |
| 30 |
\verbatim} |
| 31 |
{\endverbatim% |
| 32 |
\endminipage\par\vskip\topsep} |
| 33 |
|
| 34 |
\begin{document} |
| 35 |
|
| 36 |
\title{A Demonstration of the \texttt{pdfpages} Package} |
| 37 |
\author{Andreas MATTHIAS} |
| 38 |
\maketitle |
| 39 |
|
| 40 |
This is a demonstration of the \texttt{pdfpages} package. |
| 41 |
It is \textit{not} the documentation of the package. |
| 42 |
To get the documentation run: `latex pdfpages.dtx' |
| 43 |
|
| 44 |
\tableofcontents |
| 45 |
|
| 46 |
\section{Inserting Pages:} |
| 47 |
\begin{example} |
| 48 |
\includepdf[pages=3-5]{dummy.pdf} |
| 49 |
\end{example} |
| 50 |
\includepdf[pages=3-5]{dummy.pdf} |
| 51 |
|
| 52 |
\section{Using the \texttt{nup} Option} |
| 53 |
Arranging several logical pages on one sheet of paper. |
| 54 |
|
| 55 |
\begin{example} |
| 56 |
\includepdf[nup=2x1, landscape, pages=4-7]{dummy.pdf} |
| 57 |
\end{example} |
| 58 |
\includepdf[nup=2x1, landscape, pages=4-7]{dummy.pdf} |
| 59 |
|
| 60 |
Use the option \texttt{turn=false}, if the pages |
| 61 |
should not be displayed in landscape orientation. |
| 62 |
(If the last two pages were not displayed in |
| 63 |
landscape orientation, you use a PDF viewer that |
| 64 |
does not support this option.) |
| 65 |
|
| 66 |
\begin{example} |
| 67 |
\includepdf[nup=2x1, landscape, |
| 68 |
pages=4-7, turn=false]{dummy.pdf} |
| 69 |
\end{example} |
| 70 |
\includepdf[nup=2x1, landscape, |
| 71 |
pages=4-7, turn=false]{dummy.pdf} |
| 72 |
|
| 73 |
\begin{example} |
| 74 |
\includepdf[nup=1x2, pages=1-4]{dummy-l.pdf} |
| 75 |
\end{example} |
| 76 |
\includepdf[nup=1x2, pages=1-4]{dummy-l.pdf} |
| 77 |
|
| 78 |
\noindent |
| 79 |
With the option \texttt{pages} special pages and |
| 80 |
ranges of pages can be selected. |
| 81 |
|
| 82 |
\begin{example} |
| 83 |
\includepdf[nup=3x2, pages={1,4-6,8,10}]{dummy.pdf} |
| 84 |
\end{example} |
| 85 |
\includepdf[nup=3x2, pages={1,4-6,8,10}]{dummy.pdf} |
| 86 |
|
| 87 |
\noindent |
| 88 |
A column-major layout can be achieved with the |
| 89 |
option \texttt{column}. |
| 90 |
|
| 91 |
\begin{example} |
| 92 |
\includepdf[nup=2x2, pages=1-4, column]{dummy.pdf} |
| 93 |
\end{example} |
| 94 |
\includepdf[nup=2x2, pages=1-4, column]{dummy.pdf} |
| 95 |
|
| 96 |
\noindent |
| 97 |
Sometimes it might be useful to put an empty page |
| 98 |
at the beginning. |
| 99 |
\begin{example} |
| 100 |
\includepdf[nup=2x2, pages={{},5-7}]{dummy.pdf} |
| 101 |
\end{example} |
| 102 |
\includepdf[nup=2x2, pages={{},5-7}]{dummy.pdf} |
| 103 |
|
| 104 |
\section{Changing Layout} |
| 105 |
|
| 106 |
To put some space between the logical pages, use the option |
| 107 |
\texttt{delta}. |
| 108 |
|
| 109 |
Any options of \verb|\includegraphics| are allowed in |
| 110 |
\verb|\includepdf| as well. See the \texttt{scale} |
| 111 |
option in the next example. |
| 112 |
\begin{example} |
| 113 |
\includepdf[nup=2x2, pages=3-6, scale=.8, |
| 114 |
delta=8mm 11mm, frame]{dummy.pdf} |
| 115 |
\end{example} |
| 116 |
\includepdf[nup=2x2, pages=3-6, scale=.8, |
| 117 |
delta=8mm 11mm, frame]{dummy.pdf} |
| 118 |
|
| 119 |
\noindent |
| 120 |
By default the output is centered, as you could see in |
| 121 |
the last examples. With the \texttt{offset} option it is |
| 122 |
possible to displace the output. |
| 123 |
|
| 124 |
\begin{example} |
| 125 |
\includepdf[nup=2x2, pages=3-6, scale=.8, |
| 126 |
offset=5mm 7mm, frame]{dummy.pdf} |
| 127 |
\end{example} |
| 128 |
\includepdf[nup=2x2, pages=3-6, scale=.8, |
| 129 |
offset=5mm 7mm, frame]{dummy.pdf} |
| 130 |
|
| 131 |
\noindent |
| 132 |
To remove the header and the footer of the inserted |
| 133 |
document use the \texttt{trim} and \texttt{clip} |
| 134 |
options of the \texttt{graphicx} package. |
| 135 |
|
| 136 |
\begin{example} |
| 137 |
\includepdf[nup=2x2, pages=1-4, |
| 138 |
trim=0 40mm 0 40mm, |
| 139 |
clip, pagecommand={}]{dummy.pdf} |
| 140 |
\end{example} |
| 141 |
|
| 142 |
\noindent The option |
| 143 |
\verb|pagecommand={\thispagestyle{empty}}| |
| 144 |
is set by default. If you don't want the page style |
| 145 |
to be set to empty, you can remove this default |
| 146 |
setting by using the \texttt{pagecommand} option |
| 147 |
as follows: |
| 148 |
\verb|pagecommand={}|. |
| 149 |
|
| 150 |
\includepdf[nup=2x2, pages=1-4, |
| 151 |
trim=0 40mm 0 40mm, |
| 152 |
clip, pagecommand={}]{dummy.pdf} |
| 153 |
|
| 154 |
\noindent |
| 155 |
You like the crazy way? Then try this one \texttt{;-)} |
| 156 |
\begin{example} |
| 157 |
\includepdf[pages={3,4}, nup=2x1, |
| 158 |
landscape, scale=1.1, |
| 159 |
angle=30, delta=0 -85mm]{dummy.pdf} |
| 160 |
\end{example} |
| 161 |
\includepdf[pages={3,4}, nup=2x1, |
| 162 |
landscape, scale=1.1, |
| 163 |
angle=30, delta=0 -85mm]{dummy.pdf} |
| 164 |
|
| 165 |
\end{document} |
| 166 |
\endinput |
| 167 |
%% |
| 168 |
%% End of file `pdf-ex.tex'. |