John Conde
John Conde

Reputation: 219834

PDFlib give pdf_fit_textline a border

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?

Upvotes: 1

Views: 1802

Answers (1)

Marc B
Marc B

Reputation: 360702

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');

Upvotes: 2

Related Questions