aspose file tools*
The moose likes Other Open Source Projects and the fly likes How to add curve to the pdftable in itext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "How to add curve to the pdftable in itext" Watch "How to add curve to the pdftable in itext" New topic
Author

How to add curve to the pdftable in itext

vijay jamadade
Ranch Hand

Joined: May 12, 2008
Posts: 241
Hi ranchers,

I have created a report pdf file in itext. I have two tables in that which has some data in it. Generally the tables we create in itext have sharp edge corners. I want to have the rounded corners for my table.

I searched a lot but couldn't found any idea for that. Please tell me what to do.


Regards, Vijay Jamadade.
( Nothing is Impossible.)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
The solution lies in table events and cell events (depending on whether you want the complete table to have round corners, or individual cells). See the section "Cell and Table Events" here.
vijay jamadade
Ranch Hand

Joined: May 12, 2008
Posts: 241
Hi Ulf,
The problem is the tutorial www.lowagie.com/iText at this link is too old and doesn't contain the layout related example for table to refer. Can you please send me some sample ? Really I have searched a lot. Please help me out.

One more thing is adding the page numbers automatically if the page goes beyond one page to the second page. when I searched for it, it gave me something to implement the 22 methods for the things like addition of page numbers. Is it ok that for adding a small thing like page number I will need to this stuff. Or there is another way I am missing.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
I'm not aware of full examples of doing what you're asking. But the key to custom table drawing are table events, and those example codes show how those can be used to customize table appearance. That should give you a pretty good start.

I don't know what you mean by "22 methods". An example of how to add page numbers to a document can be found at http://faq.javaranch.com/java/ItextExample
vijay jamadade
Ranch Hand

Joined: May 12, 2008
Posts: 241
I got the solution Ulf, You need to have a inner class as



and after that add that event to cell




It will have the rounded corners for that cell depending on the last attribute
 
wood burning stoves
 
subject: How to add curve to the pdftable in itext