[texhax] PDF pages with fancyfooter
Jerry
jerry at seibercom.net
Sun Nov 18 17:29:26 CET 2018
I am trying to get the footer printed on a PDF page in landscape orientation
the same as it is on a regular portrait page. I found a possible solution
while Googling. Now, a PDF displayed on a page in portrait format does have
the full “fancy” footer and header. On a PDF page displayed in landscape
format, only the page info is displayed in the center of the page.
I have tried all sorts of tricks to get it to work the same in both
instances, but without success. I either get error messages or it just
doesn’t display correctly. What disturbs me most is that I can accomplish
this easily in MS Word.
I am not a guru in Latex, so I would welcome any help available. I do have
the “hyperref” package loaded; however, I could not find anything in it that
might help me
\documentclass[12pt,letterpaper,notitlepage]{report}
\usepackage{pdfpages} % \includepdf{FILE}
\includepdfset{pagecommand=\thispagestyle{fancy}}
\fancypagestyle{mylandscape}{%
\fancyhf{}% Clear header/footer
\fancyfoot[c]{% Footer
\makebox[\textwidth][r]{% Right
\rlap{\hspace{\footskip}% Push out of margin by \footskip
\smash{% Remove vertical height
\raisebox{\dimexpr.5\baselineskip+\footskip+.5\textheight}{% Raise vertically
\rotatebox{90}{
Page \thepage\ of \pageref*{LastPage}}}}}}
}% Rotate counter-clockwise
\renewcommand{\headrulewidth}{0pt}% No header rule
\renewcommand{\footrulewidth}{0pt}% No footer rule
}
\pagestyle{fancy} % set page style to fancy
\fancyfoot{} % clear the footers
\fancyhead{} % clear the headers
\renewcommand{\headrulewidth}{0pt} % Eliminate the head rule line
\renewcommand{\footrulewidth}{2.0pt} % Create a separator line between the document and the footer 2.0pt wide
\pagenumbering{arabic}
\fancyfoot[l]{{\footnotesize \textbf{Left Side Info}}}
\fancyfoot[c]{{\footnotesize \textbf{Center Info}}}
\fancyfoot[r]{{\footnotesize \textbf{Page \thepage\ of \pageref*{LastPage}}}}
\begin{document}
% Document information, etcetra
\includepdf[pages=-,landscape,pagecommand=\thispagestyle{mylandscape}]{Path-To-File}
\end{document}
--
Jerry
More information about the texhax
mailing list