Hi all,
I am looking for an elegant way to place and label objects like a
"roundRectangle" using ColumnText.
My current solution is to use a scaled transparent 1x1 gif (provided with
setGenericTag) as placeholder and draw/label my objects, after the exact
position is determined.
Snippet1:
...
Image img = Image.getInstance("transparent.gif"); // 1x1
img.scaleAbsolute(desired_width, desired_height);
Chunk myChunk = new Chunk(img, 0, 0);
myChunk.setGenericTag("Information_about_Objecttype_and_Objectlabel");
P.add(myChunk);
...
Snippet2:
...
public void onGenericTag(PdfWriter writer, Document document, Rectangle rect,
String text)
{
cb = writer.getDirectContent();
...
cb.roundRectangle(rect.left(), rect.bottom(), ...);
...
ClmnTxt.showTextAligned(cb, ..., new Phrase(getLabelfromGenericTag(text),
getFontinfofromGenericTag(text)), rect.left()+ getOffsetXfromGenericTag(text),
rect.bottom() + getOffsetYfromGenericTag(text), 0);
...
}
...
Is there a better way to get objects with dynamic shape/size/color/label which
work together with ColumnText ?
Best regards,
Andreas Meyer
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions