I am working on a scanned PDF document to add a rectangular shape on the header to hide header text on all pages of the entire document. To incorporate the external PDF's I use the pdfpages package. Does anyone here know if, and if yes, how it can be done?
I'm stumped, any help will be appreciated.
Here is the code :
\documentclass[12pt]{article}
\usepackage{pdfpages}
\usepackage{tikz}
\newcommand{\mycbox}[1]{\tikz{\path[draw=#1,fill=#1] (0,0) rectangle (15cm,1cm);}}
\begin{document}
\mycbox{red}
\includepdf[pages=-,picturecommand*={\put(400,680){\Huge Some text}}]{original.pdf}
\end{document}
The screenshot of the original pdf is :
And the required output should be:
The source pdf is here.
Best Answer
You can use the
current page
Tikz node's anchors andoverlay
the page with a Tikz picture. I used two rectangles, red and white, like in the desired output.Adjust the
yshift=
parameter as desired.MWE
Edited to add:
To keep the original border frame visible, you can shrink the overlaid rectangles slightly:
with