This modified code works for me using the iText version that is in the CVS.
Best Regards, Paulo Soares ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 12, 2002 23:37 Subject: [iText-questions] Tables (both types) with PdfTemplate-based images > I have been doing some testing, and have found some problems regarding > PdfTemplate-based image support -- specifically within tables. > > 1. When I create a Table object with "new Table(1)", and add 5 cells to > it, the application crashes due to an ArrayIndexOutOfBoundsException > while the table converts itself to a PDFContentByte. I am fairly > certain this is due to the fact that the table crashes when it tries to > span the page, since 4 such cells will fit on the page. Each Cell has > one element - a PdfTemplate containing the pixels from the Canvas > subclass attached to this message. > > 2. When only 4 such cells are used, they display OK in Acrobat Reader 5 > using Win2000. However, when one goes to print the PDF, the first three > cells appear on the page correctly, with the fourth one at a seemingly > random location. Frequently it overlaps one of the first three and is > smaller than the first three (although all cells are created in the same > fashion). With more complex documents, the PdfTemplate-based images > tend to stack on top of each other when printed (and sometimes when > scrolling in Acrobat). > > This wrong rendering occurs independent of the printer I use - > PostScript or not (I have tried both with a HP Color LaserJet 4550N that > supports PS level 3 as well as HP's PCL 6). > > 3. Problem #2 occurs with PdfPTable as well. PdfPTable drops cells it > can't fit onto a page and so does not have the first exception. > > What's really interesting about this is that "Raw" images created using > java.awt.BufferedImage do not have this problem, but instead are > sometimes scaled down and then lose detail or such, so PdfTemplate > really si the best solution if the PdfContentByte generation and > positioning problems can be fixed. > > The other strange thing about this is that the problem usually happens > when the table w/ images is on the second or subsequent pages of the > document. > > > __________________________________________________________________ > Your favorite stores, helpful shopping tools and great gift ideas. > Experience the convenience of buying online with Shop@Netscape! > http://shopnow.netscape.com/ > > Get your own FREE, personal Netscape Mail account today at > http://webmail.netscape.com/ > >
TemplatePanel.java
Description: Binary data