45

My institution's letterhead is available as a PDF file. The PDF is not just of the logo (to be placed in a corner), but of the entire page. Is it possible to make this PDF the background of the first page of my document?

3 Answers 3

55

You can accomplish this with the wallpaper package. It has many options for creating background images that are tiled, centered, and scaled, on every page or only specific ones. In your case if the letterhead is contained in lh.pdf then you simply need

\documentclass{article}
\usepackage{wallpaper}
\ULCornerWallPaper{1}{lh.pdf}
\begin{document}
  Your text on the letterhead
\end{document}

The key command in this case is of course \ULCornerWallPaper{<scale>}{<file>} that places the image contained in <file> in the upper-left corner, scaled by a factor of <scale>.

6
  • didn't he say he wants the entire page, rather than just the logo on the corner?
    – Vivi
    Aug 2, 2010 at 19:34
  • 6
    Yes, but based on his description it sounded to me as if the file I called lh.pdf is the size of the entire page. So when it's placed in the upper-left corner, it covers the whole page... Aug 2, 2010 at 19:59
  • 1
    Thank you Michael for sharing this. Your tip has been extremely useful for some documents that I had to deal with recently.
    – mfriedman
    Nov 5, 2011 at 22:17
  • I have certain PDF's that when used as wallpaper in this way (or eos-pic way) produce final PDF files that can not be opened by Acrobat Reader (but can be opened with Evince). I didn't find the pattern for this problem, any ideas?
    – alfC
    Jan 10, 2013 at 0:54
  • If your output pdf, produced after the use of the wallpaper package, can be opened by Evince but not with Acrobat Reader, you can fix it using ghostscriptL gs -o repaired.pdf -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress corrupted.pdf. You can find more details on the SuperUser site.
    – user66622
    Nov 21, 2014 at 13:48
10

The package eso-pic allows to include a background image at each page but also on a single page.

Another option is to use the textpos package that can put a box at a position on the page behind the text. It can be used together with \includegraphics and a PDF file.

9

Here is a example with eso-pic, that uses frontpage.pdf for the first page and normalBackground.pdf for the rest.

First create 2 macros that can be used later.

\usepackage{graphicx}
\usepackage{eso-pic}

\newcommand\BackgroundPicFront{
    \put(0,0){%
        \parbox[b][\paperheight]{\paperwidth}{
            \vfill
            \centering
            \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{frontpage}%
            \vfill
        }
    }
}

\newcommand\BackgroundPic{
    \put(0,0){%
        \parbox[b][\paperheight]{\paperwidth}{
            \vfill
            \centering
            \includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{normalBackground}%
            \vfill
        }
    }
}

Then use those macros and don't forget to "clear"/"remove" the first background when you add the next background.

% Sets the background
\AddToShipoutPicture{\BackgroundPicFront}

% Unsets the background
\ClearShipoutPicture

% Sets another background
\AddToShipoutPicture{\BackgroundPic}

Have fun

3
  • Johan, it looks like the two \BackgroundPic* commands do exactly the same thing except that they use two different image files. Is there any reason why they couldn't be defined as LaTeX commands with an argument, so that there is only one new command needed? Also, am I correct that if, after the first page, plain paper is needed, then there is no need to call \AddToShipoutPicture{\BackgroundPic} after \ClearShipoutPicture?
    – Mars
    Mar 24, 2019 at 3:05
  • Added a % after the \put(0,0){. The image was shifted a bit to the right without the %.
    – Niko Fohr
    Oct 30, 2023 at 9:43
  • 1
    @Mars you're correct, if you want to just set one background, you don't have to call \AddToShipoutPicture{\BackgroundPic} after the \ClearShipoutPicture
    – Niko Fohr
    Oct 30, 2023 at 9:44

You must log in to answer this question.

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