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...).

3 Answers 3


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.
  • Aye. This may also be possible with Inkscape or Illustrator. Commented Mar 31, 2012 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
    Commented Apr 2, 2012 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. Commented Apr 2, 2012 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
    Commented Apr 2, 2012 at 13:08
  • 2
    @Jef Only replace the first character of the lines to be deleted by a percent character (comment char in PDF or PostScript). The byte count must not be changed. Commented Sep 29, 2015 at 11:20

I tried the qpdf as suggested, and it worked for me with libreoffice generated pdf. I created a 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"
  • +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
    Commented Sep 29, 2015 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
    Commented Sep 29, 2015 at 11:15
  • Indeed it worked! Commented Apr 5, 2019 at 13:24

I used Inkscape to modify an existing PDF and selected checked background in document properties and it worked perfectly !

  • Welcome to TeX.SE!
    – Mensch
    Commented May 12, 2021 at 20:19
  • Inkscape worked very nicely for me as well. During import and saving, a popup was shown offering me some options, but I could leave all set to the default. It even allowed me to fix a typo in the PDF I thought was to stay there forever.
    – TuringTux
    Commented Jan 14 at 11:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .