views:

9

answers:

1

I'm generating PDFs dynamically using PHP and PDFlib and some of the fields require text being centered on blank fields lines (like you would see on a paper form). To make sure I have the text field using the maximum width available to me as well as positioned properly I would like to place a temporary border around it so I can see where it is and its size. Unfortunately I do not see any way to do this in the PDFlib manual.

Does anyone know of a tip, trick, or obscure documentation that will allow me to either give these fields a border or some other means of determining their exact size and position?

+1  A: 

You can put a showborder=true into the various fit/fill calls' optional parameters argument, and PDFlib will draw a simple solid border around the box:

PDF_fit_textline($handle, 'blah blah blah', $fontsize, $x, $y, 'boxsize={ 50 100 } showborder=true');
Marc B
That does exactly what I need. Thank you.
John Conde