[Tex/LaTex] How to place edge-to-edge image across top of page

backgroundsgraphics

I have a patterned background vector image that I'd like to place across the top of one page of my multipage document (a report if it matters).

The image is not the full size of the page, so what I'd like to do is scale it so that it is edge-to-edge from the left to the right, flush with the top edge (e.g. a bit like how the image on this page looks). The rest of the page contents would be laid out as if the background image wasn't there.

How would I be able to place this image without having to pull in some very heavy weight packages?

Best Answer

Probably the easiest way is using the background package. Hopefully, this does not count as "heavy weight":)

Here's how I would do it:

\documentclass{article}
\usepackage{background}
\usepackage{graphicx}

\usepackage{mwe}
\backgroundsetup{placement=top,
  contents={\includegraphics[width=\textwidth,height=2truemm]{example-image-a}}
}
\begin{document}
  \lipsum[1]
\end{document}

and this is what this produces:

enter image description here

You can scale, trim, crop, .. the image using the option of the graphicx package.