# Text boxes with scalable image as background

Is it possible to define text boxes with modifiable with and height which use a background image which should scale when you modify the width or height of the box. More complicated, it should be allowed in some way, that the background image has some elements which should scale and other which are not allowed to scale. For example consider something like this:

In that cases the pins for example should not scale, but the slip of paper should do.

-
I would use TikZ for this. Define an own environment which places its content in a \node and draw the elements relative to its coordinates. See How to make a textbox with this TikZ code ? for a code example. –  Martin Scharrer Jul 13 '11 at 8:52
This question has the same idea as in Superimposing graphics –  xport Jul 13 '11 at 17:29

Run it with xelatex. With the optional argument [showgrid] you can see a grid for better placing the objects.

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Viner Hand ITC}
\usepackage{graphicx,pstricks}
\newsavebox\IBox
\pagestyle{empty}
\begin{document}

\savebox\IBox{\includegraphics{/tmp/demo.jpg}}
\begin{pspicture}%[showgrid]% only for showing the grid
(\wd\IBox,\ht\IBox)
\rput[lb](0,0){\usebox\IBox}
\rput[l]{-5}(1.8,2.5){\small Birthday!}
\rput[l]{60}(1,2.5){\small\TeX!}
\end{pspicture}

\end{document}


-
Thanks. Why do I need xelatex? Is is possible to do this in latex (pdflatex), too? –  student Oct 19 '11 at 13:45