| 1 |
\chapter{Including PDFs}\label{sec:includingpdfs} |
| 2 |
\warning{While it is possible to have horizontal pages with the page numbers centered on the bottom long edge, I \textit{DO NOT} recommended it. This is because, while it looks okay in a digital format, this is not suitable for printing... this would print page numbers on the side of the page rather than consistently on the bottom or in the heading.} |
| 3 |
|
| 4 |
The package that is used to include PDF's is \pkg{pdfpages}. |
| 5 |
This provide the main command \cmd{includepdf} that can be used to include a PDF. |
| 6 |
Further, this package provides another command, \cmd{includepdfset}, that can be used in the start of the document to pre-set some of the default values. |
| 7 |
This class file detects the presence of this package and invokes this command as follows: |
| 8 |
|
| 9 |
\begin{lstlisting}[float=ht,caption=,label=lst:pdfDefaults,style=LaTeXStyle,basicstyle=\ttfamily,] |
| 10 |
\includepdfset{pages=-,scale=0.85,pagecommand=\thispagestyle{STYLE}} |
| 11 |
\end{lstlisting} |
| 12 |
Where \opt{pages=-} defaults to including all pages from the PDF and \opt{scale=0.85} scales the inserted PDF to 85\% of its original size, so that the documents fit within the page's margins, headers, and footers. |
| 13 |
|
| 14 |
Further, the option \opt{pagecommand=\cmd{thispagestyle}\mopt{STYLE}} sets the pagestyle for the PDF pages, where, \texttt{STYLE} is replaced with the current pagestyle\footnote{To change the pagestyle of this one can add or remove the class option \opt{fancyheaders}.} that is in use. |
| 15 |
|
| 16 |
\section{How to Insert a Portrait PDF} |
| 17 |
To insert a portrait-oriented PDF into your LaTeX document, you can use the \pkg{pdfpages} package, which provides a convenient way to include external PDF files. |
| 18 |
The following code snippet demonstrates how to include a portrait PDF with the specified options: |
| 19 |
|
| 20 |
\begin{lstlisting}[float=ht,caption=,label=lst:portraitPDF,style=LaTeXStyle,basicstyle=\ttfamily,] |
| 21 |
\includepdf{./99_Inclusions/PDFs/examplePDF} |
| 22 |
\end{lstlisting} |
| 23 |
|
| 24 |
\includepdf{./99_Inclusions/PDFs/examplePDF} |
| 25 |
\section{How to Insert a Landscape PDF} |
| 26 |
Inserting a landscape-oriented PDF is similarly straightforward using the \pkg{pdfpages} package. |
| 27 |
The code snippet below demonstrates how to include a landscape PDF: |
| 28 |
|
| 29 |
\begin{lstlisting}[float=ht,caption=,label=lst:landscapePDF,style=LaTeXStyle,basicstyle=\ttfamily,] |
| 30 |
\includepdf[landscape=true]{./99_Inclusions/PDFs/landscapePDF} |
| 31 |
\end{lstlisting} |
| 32 |
|
| 33 |
Here, \opt{landscape} sets the orientation to landscape. |
| 34 |
This configuration ensures that your landscape PDF is correctly oriented and properly sized within your document. |
| 35 |
|
| 36 |
\includepdf[landscape]{./99_Inclusions/PDFs/landscapePDF} |