背景画像(background パッケージを使用)を PDF(pdfpages パッケージを使用)で上書きする

背景画像(background パッケージを使用)を PDF(pdfpages パッケージを使用)で上書きする

PDF をはっきり表示したいだけです。pdfpages パッケージを使用して、背景画像 (jpg ファイル) を PDF で上書きする方法はありますか? または、PDF に個別に不透明度を使用する方法はありますか?

\documentclass{book}
\usepackage{graphicx}
\usepackage[paperwidth=11.7in, paperheight=8.3in]{geometry}
\usepackage{background}
\usepackage{pdfpages}

\backgroundsetup{
position={5.4125in,-3.5in},
scale=.9,
angle=-.5,
opacity=0.2, 
contents={\includegraphics{ImageName}}
}

\begin{document}

\includepdf[pages=-]{filename}

\end{document}

答え1

これでうまくいくはずです。要件に応じて強化できるよう、コメントにさらに質問を追加してください。

\documentclass{article}
\usepackage[paperwidth=11.7in, paperheight=8.3in]{geometry}
\usepackage[pages=some]{background}
\usepackage{pdfpages}

\backgroundsetup{
scale=0.9,
opacity=0.2,
angle=-.5,
position={5.4125in,-3.5in},
contents={%
  \includegraphics[width=\paperwidth,height=\paperheight]{Small-mario.png}
  }%
}
\begin{document}
 \BgThispage
 \includepdf[pages=-]{Test2}
 \clearpage
\end{document} 

ここに画像の説明を入力してください

答え2

backgroundパッケージは 上に構築されtikz、は、具体的にはコマンドpdfpages上に構築されるため、次のように実行できます。graphicx\includegraphics

環境ではtikzpicture、環境を使用して画像を背景レイヤーに配置しますpgfonlayer。PDF は、メイン レイヤーに配置することで背景画像の上に重ねることができます。これは、コードに明示的に記述する必要はありません。背景画像の不透明度は、上に重ねた PDF の可視性に影響を与えずに、任意の値に設定できます。これは、、および の 3 つの背景画像で示されてopacity=0.9opacity=0.5ますopacity=0.1

\documentclass[a4paper,10pt]{article}
\usepackage[showframe,margin=2.5cm]{geometry}
\usepackage{graphicx}
\usepackage{MWE} % for example-image-a.png and example-image-a4.pdf
\usepackage{tikzpagenodes} % for (current page text area.north)
\usetikzlibrary{backgrounds} % for {pgfonlayer}{background}

\pgfdeclarelayer{background}   % add the background layer
\pgfsetlayers{background,main} % specify the order of the layers

\begin{document}
\begin{tikzpicture}[remember picture, overlay]
% Put images in the background
\begin{pgfonlayer}{background}
\node[opacity=0.9,anchor=north] (A) at (current page text area.north) {\includegraphics[scale=0.5]{example-image-a}};
\node[opacity=0.5,below=3cm]  (B)   at (A.south) {\includegraphics[scale=0.5]{example-image-a}};
\node[opacity=0.1,below=3cm]  (C)   at (B.south) {\includegraphics[scale=0.5]{example-image-a}};
\end{pgfonlayer}
% Put an image in the main layer
\node at (current page text area.center) {\includegraphics{example-image-a4}};
\end{tikzpicture}

\end{document}

ここに画像の説明を入力してください

関連情報