Reputation: 959
I use SAXItexthandler
to achieve custom underlining of specified thickness, color & specified Y position using the below code. So basically i have different strings in multiple itext cells in a itext row and the below code helps me to do the underlining for every chunk where every chunk is embedded within a cell and it works perfectly fine.
Color c = Color.decode(custom_color);
currentChunk.setUnderline(c, thickness, 0.01f, ypos, 0.01f, PdfContentByte.LINE_CAP_BUTT);
Now is there a way i can just make the underline dashed? I use the above code heavily and we have a new requirement for dashed underlines only in a few places. So i would like to know if i can achieve it using setUnderline
itself.
Upvotes: 0
Views: 927
Reputation: 7871
You can use generic tags on chunks:
PdfPageEventHelper
and add it to the writeronGenericTag
method onGenericTag
method you have the surrounding rect of the chunk: you can draw a line directly on the PdfContentByte using a dashed style or whatever style you desire.Upvotes: 1