[Tex/LaTex] Import pdf with white background

beamergraphicspdf

I have a beamer presentation where the text is in white and the background is black. For some frames I would like to import some pdfs but have them exactly as they are normally. That is all the white space should still be white. The effect should be a white rectangle in the middle of the screen which has the pdf with black borders all around. I think the issue is transparency so I really want to make the transparent parts of the pdf white.

How can you do this?

Here is a skeleton MWE.

\documentclass[xcolor=svgnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\setbeamerfont{title}{size=\Huge}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\setbeamercolor{title}{fg=white}
\setbeamercolor{frametitle}{fg=yellow}

\begin{document}
 \begin{frame}
  \begin{center}
\begin{figure}
 \includegraphics[width = 7cm]{pdf-page}
\end{figure}
\end{center}
 \end{frame}

\end{document}

Best Answer

Maybe you can use a simple \colorbox:

\documentclass[xcolor=svgnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{mwe}% to get an example image

\setbeamerfont{title}{size=\Huge}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\setbeamercolor{title}{fg=white}
\setbeamercolor{frametitle}{fg=yellow}

\begin{document}
\begin{frame}
   \begin{center}
   {\setlength\fboxsep{0pt}%
      \colorbox{white}{\includegraphics[width = 7cm]{example-image-a4-landscape}}%
   }
  \end{center}
\end{frame}
\end{document}

enter image description here

Related Question