# Make page numbers stand out from PDF background

I am compiling a document from many full-page PDFs and add a table of contents. Because the PDFs are full page, the page number might not stand out from the background. Is there a good way to make them stand out? (I would prefer not to scale the included pages down to make room for the footer because some pages already have some pretty small print.)

\documentclass[a4paper,11pt]{article}
\usepackage{pdfpages}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}

\includepdfset{noautoscale=true, pagecommand={\thispagestyle{plain}}}

\begin{document}
\tableofcontents

\section{Documents}
1, subsection,1,One,h1,
2, subsection,1,Two,h2,
3, subsection,1,Three,h3
}]{blahblah.pdf}
\end{document}

• Do you have any thoughts on how (design wise) it should look? (For example have the page number in a colored box.) Apr 11 '18 at 16:46
• Apr 11 '18 at 17:02
• @TorbjørnT. A white box that masks the background would work. Apr 11 '18 at 18:01

You could make a new page style with fancyhdr and place the page number in a \fcolorbox with white fill.

\documentclass[a4paper,11pt]{article}
\usepackage{pdfpages}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{xcolor}
\usepackage{fancyhdr}
\fancypagestyle{pageno}{
\setlength\fboxsep{5pt}
\fancyhf{}
\fancyfoot[C]{\fcolorbox{white}{white}{\thepage}}
}

\usepackage{hyperref}

\includepdfset{noautoscale=true, pagecommand={\thispagestyle{pageno}}}

\begin{document}
\tableofcontents

\section{Documents}

• To set the frame of the box, I'm using \setlength\fboxrule{0.2pt} and \fcolorbox{black}{white}{\thepage}. Apr 12 '18 at 13:26