This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply 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: 224
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: 35241
    
    7
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.


Android appsImageJ pluginsJava web charts
vijay jamadade
Ranch Hand

Joined: May 12, 2008
Posts: 224
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: 35241
    
    7
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: 224
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to add curve to the pdftable in itext
 
Similar Threads
printing a form
Placing Text on iText PDF Output
PDF with java
Putting borders around images
iText and HTML Controls