Using the Latex eso-pic package I am inserting a background image using the following lines:
\AddToShipoutPictureBG{
\AtStockLowerLeft{
\includegraphics[width=\paperwidth,height=\paperheight]{picture}}}
\begin{document}
...
This works; every page now has my picture as the background. However, as soon as I insert a picture in any of my chapters and I open the created *.pdf document using adobe reader (after succesfull compilation using pdflatex), adobe crashes with the following message: "There was an error processing a page. There was a problem reading this document (131).". I use the following lines for inserting pictures:
\begin{figure}[h]
\begin{centering}
\includegraphics[width=1.0\columnwidth]{my_picture}
\par\end{centering}
\protect\caption{This is my picture.
\label{fig:my_picture}}
\end{figure}
I have the feeling that this is caused by the fact that I'm trying to draw two pictures on top of each other (background + in-text picture). But I have no idea on how to solve this. Any ideas?
Below I added an example:
\documentclass[english]{report}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[a4paper]{geometry}
\usepackage{graphicx}
\usepackage{eso-pic}
%Uncomment following lines to enable background picture (note that there is a
%bug right now, for some reason having a background image and iserting images
%using \includegraphics does not work correctly. It does compile but *.pdf
%document can not be opened.)
%\AddToShipoutPictureBG{
% \AtStockLowerLeft{
% \includegraphics[width=\paperwidth,height=\paperheight]{background}}}
\begin{document}
% ---------------------------------------------------------------------------- %
\chapter{Introduction \label{chap:Introduction}}
\section{Background}
Blabla
\begin{figure}[htb]
\centering
\includegraphics[width=1.0\columnwidth]{figure_1}
\caption{This is my first picture.}\label{fig:figure_1}
\end{figure}
% ---------------------------------------------------------------------------- %
\chapter{Conclusion \label{chap:Conclusion}}
\section{Conclusion}
We can draw the following conclusions:
\begin{itemize}
\item Conclusion 1
\end{itemize}
\begin{figure}[htb]
\centering
\includegraphics[width=1.0\columnwidth]{figure_2}
\caption{This is my second picture.}\label{fig:figure_2}
\end{figure}
% ---------------------------------------------------------------------------- %
\end{document}
This code compiles fine and I can open the resulting PDF file. However, as soon as add the background by uncommenting the comment lines compiling is no problem but viewing using acrobat reader is a different story: "There was a problem opening this document. The file is damaged and could not be repaired."
\documentclass{...}
, the required\usepackage
's,\begin{document}
, and\end{document}
. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code!