Unfortunately there hasn't been anyone else adding the textBox feature to the PHP CPDF functions, so I had to it. ;)
in order to get a cpdf_textbox function, so that you don't have to call the cpdf_text function for every single line of text you want to print.
patch: http://mpex.net/software/mirror/cpdf_patch
Then recompile php with cpdf support and use the new function.
It has to be called in between the cpdf_begin_text and cpdf_end_text tags
cpdf_textbox(int pdfdoc, double x-koor, double y-koor, double width, double height, double angle, double linespace, string text [, int alignmode [, float paragraphspacing [, int newlinemode]]]);
Notes:
Alignmode aligns the text within the box:
0 -- left (default)
1 -- center
2 -- right
3 -- justify
Newline mode:
if non-zero, NL ("\n") is a line break, if 0 reformatted (default 0)
Have fun with it. It works great for me. ;)
XeROfun