Skip to content

Instantly share code, notes, and snippets.

@GrantTrebbin
Created February 28, 2024 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GrantTrebbin/89e6d9a5f17e82e843a857bbe678c1c5 to your computer and use it in GitHub Desktop.
Save GrantTrebbin/89e6d9a5f17e82e843a857bbe678c1c5 to your computer and use it in GitHub Desktop.
Resise PDF and add page numbers with LaTeX
% pdfbind.tex
\documentclass[10pt,a4paper,twoside]{report}
\usepackage[final]{pdfpages}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{fancyhdr}
\usepackage{lastpage}
\pagestyle{fancy}
\fancyhead{} % clear header
\fancyfoot{} % clear footer
\setlength{\headheight}{18pt}
\fancyhead[C]{\Large\textsf{Left Title \hfill Centre Title \hfill Right Title}}
\fancyfoot[CE,CO]{\Large\textsf{Page \thepage \hspace{1pt} of \pageref{LastPage}}} % add page numbers to pages
% remove bars from top and bottom of page
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}
\begin{document}
\includepdfset{offset=0mm 0cm, pagecommand=\thispagestyle{fancy}}
\includepdf[fitpaper=true,scale=0.85,pages=-]{printer-testcard-colour.pdf}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment