我想在一份文档上添加 2 个水印,但它只打印最后一个水印。
我不想在一个水印上添加两行。我需要一行水平放置在页面顶部,一行沿对角线放置在整个页面。
这是我目前正在使用的:
\special{!userdict begin /bop-hook{gsave 180 20 translate 90 rotate /Times-Roman findfont 90 scalefont setfont 0 0 moveto 0.7 setgray (HEADER) show grestore}def end}
\special{!userdict begin /bop-hook{gsave 320 100 translate 75 rotate /Times-Roman findfont 180 scalefont setfont 0 0 moveto 0.7 setgray (BODY) show grestore}def end}
答案1
您可以使用eso-pic
为了这:
\documentclass{article}
\usepackage{eso-pic,graphicx,showframe}% http://ctan.org/pkg/{eso-pic,graphicx,showframe}
\begin{document}
\AddToShipoutPictureBG*{%
\AtPageUpperLeft{\raisebox{-\baselineskip}{\makebox[\paperwidth]{This is at the top, centred}}}%
\AtPageCenter{\rotatebox{52}{\makebox[0pt]{\Huge This is diagonally across the page}}}}
Some text
\end{document}
答案2
使用背景包也是一个选项,用户可以控制比例、角度、位置、颜色、(x,y)偏移。
\documentclass[12pt]{book}
\usepackage[showframe,margin=1in]{geometry}
\usepackage{background}
\begin{document}
This is a text.
\SetBgContents{This watermark is at the top} % a watermark
\SetBgPosition{current page.center}
\SetBgAngle{0} % rotate
\SetBgColor{blue} % color
\SetBgScale{1.5} % scale
\SetBgHshift{0} % location x=0 for center
\SetBgVshift{9cm}
\makeatletter % For a second watermark on the same page then repeat
\AddEverypageHook{% % Or AddThispageHook for one time only
\SetBgContents{This watermark is diagonally laid} % a watermark
\SetBgPosition{current page.center}
\SetBgAngle{45} % rotate
\SetBgColor{red} % color
\SetBgScale{1.5} % scale
\SetBgHshift{0} % location x=0 for center
\SetBgVshift{0}
\bg@material}
\end{document}