background opacity fixed

This commit is contained in:
Marc Wäckerlin
2025-11-09 09:45:42 +01:00
parent 2c2fbdbe9e
commit af2a53a9d9
5 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -383,13 +383,15 @@ END:VCARD\BCQ@nl}
\ifcsdef{Xbackground}{%
\IfFileExists{\Xbackground}{%
% It's an image file: add to background using eso-pic (no layout impact)
\AddToShipoutPictureBG*{%
\AtPageCenter{%
% Fix XeLaTeX opacity issue: ensure TikZ/PGF is loaded before opacity is used
\AddToHook{shipout/background}[businesscard]{%
\put (\LenToUnit{.5\paperwidth},\LenToUnit{-.5\paperheight}) {%
\tikz[overlay]{\node[opacity=\fpeval{\BCQ@bgopacity}, inner sep=0pt] at (0,0) {%
\includegraphics[height=\fpeval{\BCQ@bgscale}\paperheight]{\Xbackground}%
};}%
}%
}%
\DeclareHookRule{shipout/background}{pgfrcs}{>}{businesscard}%
}{%
% Not a file: treat as color
\pagecolor{\Xbackground}%