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

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