I know this does not answer your immediate question, but you may want to look at a combination of XSLT, XSL-FO and SVG (Apache FOP and Apache Batik) to generate photo books. SVG for the page layouts, XSL-FO for the multi-page support and XSLT as the glue for everything. I'm doing that and similar things with quite some success. I assume it's possible with PDFBox but only with a lot of Java programming. Expressing the layouts in XSLT makes the whole thing much more flexible. And text centering comes free. Just my 0.05CHF.
On 14.04.2010 23:03:01 David Ekholm wrote: > Hi. Thank you for making PDFBox! > > I'm evaluating PDFBox with the purpose of generating photo books. We'd > like to add an image to each page with a centered caption text below > (1-3 lines). The question I have is how to position the text in a > centered fashion. Is there an easy way to calculate the width and > height of a text string using the currently set font? Is there a way to > automatically have long strings wrapped to a new line if they don't fit > within a certain set width? > > Regards > /David > Jeremias Maerki

