New Forum | Previous | Next | (P-PDF) Developers
Topic: low-level string formatting where length can vary
Conf: (P-PDF) Developers, Msg: 98597
Date: 10/17/2003 12:38 PM
I am an experienced software developer but new to the PDF generation. Is the following possible:
My client currently generates PDFs using activePDF and database data. For the most part this solution is okay as about 90% of the PDFs appear just fine. They have asked me to develop some granular formatting routines to fix the 10% that have issues.
The routines I wish to implement would take the database data, apply a font, and determine if the result would fit well in the allotted space on the PDF. If not then I would work with the data, i.e. strip out whitespace characters such as new lines, tab, and extra spaces, hyphenate words, or integrate line breaks and run the new string through the routines again until it fit in the allotted space. Finally I would feed this output to activePDF.
In concept I would think this could work although not easily and we'd still need to tweak the routines over time as we could not account for all scenarios up front.
Are there ways/libraries to apply fonts to data and determine low-level formatting characteristics in the way I have described? Chances are there must be standard ways of doing this as I couldn't be the first to ask so feel free to educate me if there are better/standard ideas.
Thanks for your time,