I Text, You Text, We All Text for iText



Email    print   
January 15, 2006 —  (Page 1 of 2)
I have a soft place in my heart for typesetting systems. I’ve built several over the ages, and have typeset many of my own books. My monthly C Chest column in Dr. Dobb’s Journal was canned in 1987 largely because of my “wasting” three months presenting the source code for my version of a markup-language interpreter that did layout: troff. (The editor insisted that both Unix and markup languages were irrelevant, obsolete technologies. For what it’s worth, Bill Gates was saying exactly the same thing about HTML at the time.)

I’m going to try my luck again: In my Dec. 15 column, I promised that I’d report back on a typesetting system: iText, Bruno Lowagie and Paulo Soares’ PDF-creation library. Let’s pick up that thread.

To refresh your memory, a project required me to create a few simple printed reports—the complete contents of which weren’t known until runtime—in CSV, HTML and PDF formats. I rejected JasperReports, which I found to be an overly complicated, poorly documented nonsolution to this problem. You know something’s wrong when it’s harder to use the tool than it is not to use the tool.

The iText library—the PDF-generation library that JasperReports uses—is, on the other hand, very good. iText is a full-blown typesetting system that lets you do in Java pretty much everything you can do with PostScript. You can use iText to lay out complex documents containing both text and images to produce a PDF representation. (Note that iText also can produce HTML and RTF files, but it doesn’t do as good a job in these formats as it does with PDF. The table-layout classes, essential for reporting applications, work only with PDF output, for example.)

Though it does have all the low-level APIs that you need to build a real typesetting system, the real strength of iText is the high-level objects that let you manipulate the document at the level of paragraph and chunk. (A chunk is part of a paragraph.) You assemble a paragraph simply by adding chunks of text to it, and can easily modify paragraph attributes like font size and margins. There’s also a very nice set of table-creation objects. The vast majority of applications can get by with nothing but these simple-to-use APIs.




Pages 1 2 


Share this link: http://sdt.bz/29077
 
Most Read Latest News Blog Resources

Add comment


Name*
Email*  
Country     


  • Comment
Loading




close
NEXT ARTICLE
TX Text Control 16.0 supports WPF app development
Other new features include an enhanced TextControl feature and a new generic spell-checker interface Read More...
 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 

Download Current Issue
FEBRUARY 2012 PDF ISSUE

Need Back Issues?
DOWNLOAD HERE

Want to subscribe?


 
blogs tab
Are you at risk for burnout?
Burnout is a severe problem and it can strike at any time. Here's how to tell if you are nearing the edge.
02/09/2012 02:16 PM EST

Agility, mom, and apple pie
If we're to evaluate the state-of-the-art in software development, we should start with the values espoused in the Agile Manifesto.
02/07/2012 11:57 AM EST

RIM woos developers with free tablet
How do you get more apps ported to the BlackBerry PlayBook? By giving every developer a free tablet, of course!
02/04/2012 01:57 PM EST

GitHire: Use Headhunters to Find Your Perfect Programmer
Are you a hiring manager tired of scouring the job boards? Check out this new service that will find 5 people interested in your jobs.
02/03/2012 12:17 PM EST

Facebook claims hacker cred
Facebook's SEC S-1 filing form includes a short essay on the Hacker Way by Mark Zuckerberg himself.
02/02/2012 08:26 AM EST

Ryan Dahl steps down
Ryan Dahl, creator of Node.js, steps back from his position as gatekeeper for the project.
02/01/2012 04:58 PM EST

 
Events calendar tab
2/13/2012 to 2/16/2012
Santa Clara
TechWeb

2/26/2012 to 2/29/2012
San Francisco
BZ Media

2/27/2012 to 3/2/2012
San Francisco
RSA

3/4/2012 to 3/7/2012
Las Vegas
IBM Tivoli

3/5/2012 to 3/9/2012
San Francisco
TechWeb