For my purpose, I first wish to stay with background
package if possible.
It works fine when I have texts only. Background is really background (in terms of the layers).
But when includepdf
or \fitallincludepdf
(a modified version) is used to include some pdf files, the background come foreward, which I don't like.
If you look closely, the test
is ABOVE the pdf file like an overlay.
How can I make it underneath?
The following is used to make exam-pic.pdf
.
\documentclass{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[fitpaper]{example-image-A}
\includepdf[fitpaper]{example-image-10x16}
\end{document}
Now the MWE
.
\documentclass[a4paper, 12pt, scheme=plain, twosides]{ctexart}
\usepackage{lipsum}
\usepackage{background}
\backgroundsetup{
placement=center,
scale=6,
contents={test}
}%
\usepackage{pdfpages}
\makeatletter
\newcommand\fitallincludepdf[2][]{%
\AM@findfile{#2}%
\setkeys{pdfpages}{#1}%
\expandafter\AM@readlist\expandafter{\AM@pagestemp}%
\@for\xxx:=\AM@pagelist\do{%
\edef\AM@tmp{[\unexpanded{#1},pages=\xxx]}%
\expandafter\includepdf\AM@tmp{#2}%
}}%
\makeatother
\begin{document}
\lipsum[1-10]
\cleardoublepage
\includepdf[pages=-]{exam-pic}
\fitallincludepdf[fitpaper,pages=-]{exam-pic}
\end{document}