[pdftex] pdflatex: landscape document, portrait insertions with includepdf results in page numbers placed badly
Andreas Matthias
andreas.matthias at gmail.com
Tue Nov 29 19:39:41 CET 2011
Andreas Holzhammer wrote:
> I'm trying to insert a given PDF-file in portrait orientation into a
> landscape document, which works well using the
> "fitpaper"-option. Unfortunately, page numbers get placed as if the pages
> were still in landscape.
Pdfpages just inserts external pdf pages; but it does not prepare
the current page for typesetting. If you need that you have to do
whatever you would do without using pdfpages ;-)
Here's an example:
\documentclass[a4paper, landscape, DIV10]{scrartcl}
\usepackage{pdfpages}
\makeatletter
\newcommand{\swapformat}{%
\clearpage
\setlength{\@tempdima}{\paperwidth}%
\setlength{\paperwidth}{\paperheight}%
\setlength{\paperheight}{\@tempdima}%
\setlength\pdfpagewidth\paperwidth
\setlength\pdfpageheight\paperheight
\typearea{10}%
}
\makeatother
\begin{document}
\pagestyle{headings}
\section{foobar}
Lorem ipsum \ldots
\swapformat
\includepdf[fitpaper=true, pagecommand={\thispagestyle{headings}}]{dummy.pdf}
Lorem ipsum \ldots
\swapformat
Lorem ipsum \ldots
\end{document}
Ciao
Andreas
More information about the pdftex
mailing list