My publication requires a public and non-public version. I have several figures and tables that I'd like to censor by placing a big colored block on top of it. One page suggested using \colorbox
. Unfortunately, this doesn't work for pdf files.
All of the images and tables are simple \includegraphics
.
Anyone have a clue?
Update @doncherry, this:
\begin{figure}[h!]
\centering
\colorbox{black}{\includegraphics[width=1\textwidth]{\string"Image".pdf}}
\caption{Google Adwords - BoI}
\end{figure}
produces:
Best Answer
You can use the option
decodearray
to produce a black image with a suitable switch. The image below shows the uncensored and censored image respectively.The MWE is shown below.
The code works well with
.png
as well as.jpg
images. Details fordecodearray
can be found in the PDF Reference Manual. As a matter of interest if the values of the pairs have values other than zero one can manipulate the color channels, producing a reddish image for example.Of course you will need to incorporate a suitable command to replace
\includegraphics
. One such approach is to define:To censor the images you type,
Note that the image data is still included in the pdf and can possibly be extracted, so use with caution or in cases where paper copies only will be circulated.