vandeseer / easytable

Small table drawing library built upon Apache PDFBox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support of Rectangle in Table Column

vikramtambe opened this issue · comments

I have a requirement where I want to draw rectangle in each column of rows.

e.g. I want to show the estimates and actual hours worked using filled rectangle color (RGB) for each row. In iText this can be achieved using PdfTemplate (rectangle, setRGBColorFill, setRGBColorStroke methods).

Do you have an example how it should look like in the end? Generally speaking I would say it's possible, but I don't yet fully understand your requirement.

Yes, something like this should be doable by creating a custom cell type and/or a custom drawer. Maybe start by checking the samples in the test folder. If I find some time I might also look into this, because I find that an interesting idea for showing what one can easily do with small customizations ... ;)

I looked in test folder but did not find better solution which I am looking for. I know we need to create custom cell type which will allow to draw multiple rectangles in a single column. As I said earlier, In iText this can be achieved using PdfTemplate (rectangle, setRGBColorFill, setRGBColorStroke methods).

Hey @vikramtambe,

have a look at this gist: https://gist.github.com/vandeseer/5023d55b67c455596b2703e4a65df2d9

image

It does pretty much what you are looking for, I think. Of course it still needs some adaptions, but it should be fairly simple to continue from there.

Best,
Stefan

In response to your comment on the gist file @vikramtambe: I really don't know what the issue is here. It works perfectly fine for me with a fresh setup. So this doesn't seem to be related to easytable. Maybe you can share your complete code and/or ask e.g. on stackoverflow?

@vandeseer - Looks like the build issues. I am getting lots of compilation errors when just forked the repository. I would really appreciate if you could help me the resolve these so that I can add few more customization's.

image

Does it build with maven on the console? I guess you need to install the Lombok plugin for Eclipse.

Thanks @vandeseer . I am able to resolve the issues after installing Lombok plugin.