TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an external 100 pages PDF document (not created by pdflatex) that I \includegraphics page-wise into a beamer presentation. The external PDF document employs white as page color, but I need the background to be transparent.

Ideally, this would be an option one could pass to \includegraphics – which I doubt to exist. However, I would also be open for some process involving external tools (pdftk, pdfjam, ImageMagick, Acrobat...).

share|improve this question

I'm not sure about turning anything to transparent in a PDF. PDF is not an image format, so I guess the only way is to remove the background object entriely from the pages. You could do that manually (on every page) with Acrobat professional (and probably also some free pdf editors), but if you're lucky, the following may work:

  1. Convert your PDF into something readable with qpdf -qdf file.pdf file-redable.pdf.
  2. Look in there for the background object. (Luck needed at this point) More often than not, it will look somewhat like this:

    10 765.75 591.75 -729.75 re

    That is, a filled rectangle large enough to cover the whole page.

  3. Experimentally remove it.

  4. Fix the resulting pdf with fix-qdf file-redable.pdf.
  5. Try whether it worked ;-)
  6. If you found the right object to remove, you can remove it in all places simultaneously with sed, for instance.
share|improve this answer
Aye. This may also be possible with Inkscape or Illustrator. – Martin Schröder Mar 31 '12 at 18:37
Thanks Stephan! While I managed to find the MacPorts package for qpdf, I have not yet found a tool named fix-pdf. Searching for it reveals a commercial Windows-only tool (fixpdf.org), which, however, does not look like being a command-line utility. Is that the one you refer too? – Daniel Apr 2 '12 at 11:11
@Daniel Argh, sorry. Typo. I meant fix-qdf which is part of the qdf bundle and responsible for fixing things like object tables after a "qdf" file has been edited. – Stephan Lehmke Apr 2 '12 at 11:59
:-) I have edited this also in your answer, so (after a while) we can delete these comments. As soon as I find some time I will try your suggestion. – Daniel Apr 2 '12 at 13:08
Unfortunately, I have not yet been able to find the background object. (The PDF in question is generated under Windows with OpenOffice 3.x from an OO presentation). – Daniel Apr 3 '12 at 15:51

I tried the qpdf as suggested, and it worked for me with libreoffice generated pdf. I created some script to remove the background. It may or may not work depending on version, etc, and can damage your PDF, so use at your risk

if [ $# -ne 1 ] ; then
    echo "Use: $0 pdf_with_background.pdf"
    exit 1


# backups
#cp "$FILE" "$FILE.BAK"
# converts to readable format
qpdf -qdf "$FILE" "$FILEQDF"
# removes background
cat "$FILEQDF" | sed  '/^%% Contents for page/, /f\*/ { /^1 1 1 rg/, /f\*/ { s/^/%% /  }  }' >  "$FILETMP"
# fixes pdf
fix-qdf "$FILETMP" > "$FILE"
share|improve this answer
+1 for taking this up again. Looks promising, but unfortunately does now work with my OpenOffice slides. (fix-qdf: <nam>.pdf.readable.qdf: not a pdf file) – Daniel Sep 29 '15 at 10:18
try looking at qdf for the pdf generated by openoffice and changing the sed expression; modified the script a bit, maybe it helps – Leh Sep 29 '15 at 11:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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