我正在尝试将图片作为整个 pdf 页面加载,因此我使用以下代码将图像作为节点加载并使用调整框包将其放大到整个页面:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usepackage{graphicx}
\usepackage[a4paper,margin=0pt]{geometry}
\usepackage{adjustbox}
\begin{document}
%https://upload.wikimedia.org/wikipedia/commons/1/16/Mycena_interrupta.jpg
\def\imgfile{Mycena_interrupta.jpg}
\begin{adjustbox}{width=\paperwidth,height=\paperheight}
\begin{tikzpicture}[background rectangle/.style={fill=red!40},show background rectangle]
\node (N) { \includegraphics{\imgfile}};
\end{tikzpicture}
\end{adjustbox}
\clearpage
\end{document}
答案1
根据我的评论,这是我的解决方案:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.south west) [above right,inner sep=0,outer sep=0]
{\includegraphics[width=\paperwidth,height=\paperheight]{Mycena_interrupta}};
\end{tikzpicture}
\end{document}