Hi, All

I developed web pdf service on itext 1.0, A document contains many 
sections with border, each is a Table instance. Here are some codes:

Table table = new Table(4);
table.setWidthPercentage(100);
table.setBorder(2);
table.setTableFitsPage(true);
Cell cell = new Cell();

The jar is updated to v1.4 now. And I have to use PdfPTable and PdfPCell 
instead of Table and Cell.
I found that the setTableFitsPage() for Table is unavailable in PdfPTable. 
I googled this issue, and found PdfWriter.fitsPage() is commended.
I changed the codes to this:

   if(!writer.fitsPage(table)){
      doc.newPage(); 
      doc.add(table);
} else {
      doc.add(table);
}

Unfortunaly, it did not work. Some tables are moved to a new page, a large 
space remained at the tail of a small table. To avoid this, I merged all
the contents into one table to make it unsplitable. If I go this way, I 
cannot add border for each section.


Another, PdfPTable has no border. I put it into a PdfPCell, and set border 
for PdfPCell. But this kind border is outer border, the inner one is 
expected.
Is PdfPTableEvent useful to add a inner border in PdfPTable?

Since the itext jar must be 1.4 version, any advise might I get ?


Thanks advance!


p.s.
a outer border :


a inner border :



************************************************************
HSBC Software Development (Guangdong) Limited
whose office address is
5/F Jie Tai Plaza, 218 - 222 Zhong Shan Liu Road, Guangzhou,
The People's Republic of China
************************************************************


-----------------------------------------
*******************************************************************
This e-mail is confidential. It may also be legally privileged.
If you are not the addressee you may not copy, forward, disclose
or use any part of it. If you have received this message in error,
please delete it and all copies from your system and notify the
sender immediately by return e-mail.

Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability
for any errors or omissions.
*******************************************************************
"SAVE PAPER - THINK BEFORE YOU PRINT!" 

<<image/gif>>

<<image/gif>>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to