1

The following TeX code is intended to change the background color of an external pdf file by using the pdfpages package, but it does not work for me. Does it work at all?

\documentclass{minimal}
\usepackage{xcolor}
\pagecolor[HTML]{B0A030}
\usepackage{pdfpages}
\begin{document}
\includepdf[fitpaper,pages=-]{external/notes.pdf}
\end{document}
  • It works for me. What distribution and version are you using? – N.N. Dec 26 '11 at 8:12
  • I am using all the latest versions of everything, but it seems that the problem is actually with the way the original pdf file is produced as it works for some files and not for others. Ironically in the end I got the background color of the original file changed using the accessibility option in acrobat reader (9.0 +). This seems like a better option if you want to change the background color of all pages. I found the solution here link – Nimonika Dec 26 '11 at 8:33
  • Could you please show how to produce an external pdf that does not work here? – N.N. Dec 26 '11 at 8:36
  • 9
    If the old PDF file has already a background color, it's impossible to change it by superimposing the pages to a differently colored background. The method in your example will work only if the old PDF file has no background color. – egreg Dec 26 '11 at 15:10
  • 1
    In order for this to be resolved, post notes.pdf somewhere for people to download and experiment with. Try FileDropper or DropBox. – Werner Dec 26 '11 at 21:50
3

As egreg notes in his comment, it will not be possible to change the background of the pdf file if the file has non transparent background to start with. In that case, I think the only way to do it is edit the file in a pdf editor (Adobe Acrobat, od pdfedit on linux, and either change the color of the background element on each page, or delete each background element, and then use pdfpages to change the background color.

3

Instead of using pdfpages to change the background colour, you may draw a white box around it in beamer:

\colorbox{white}{\includegraphics{your-pdf-figure}}

Read more here: ADDING white background to an image?

  • Welcome to TeX.sx! I've suggested an edit to your post to add the proper formatting, which should be visible shortly. – wrtlprnft Apr 13 '16 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.