I am trying to make a script add a few lines of text into a PDF form. I have no control of the form's creation and it is not editable, but I find the answer given to question "can I use Ghostscript to overlay a text (fax) header onto a PDF and/or TIFF?" almost solves my problem. Except I occasionally need to wrap the inserted text, so that it breaks into two lines. I know the width of the target "box" beforehand.
I am currently using GhostScript with pdfwrite, for instance:
gs -o /tmp/desc.$$.pdf -sDEVICE=pdfwrite -c "/Helvetica findfont 9 scalefont setfont" -c "87 328 moveto ($2) show showpage"