Bruno,

Yes, I don't quite understand this point.  I bought the book and spent
all New Year's weekend studying it.  My main computer language is RPGLE
on an IBM midrange for twenty years and I also wrote COBOL for ten
years.  Now I also write a bit of Java.  It does get frustrating when I
can pump in a few hundred lines of code a day but then it sometimes
takes two or three days to figure out how to do just one function.

In the book, page 284, it notes that drawing lines and shapes is called
"constructing and painting paths".  So, what is a path?  I understood it
to be setting a starting position in a table cell and then placing
something there.  The example you returned to me does the same as the
example in the book, it simply draws a line through the table cell.  So
you moveTo() a starting point and then lineTo() a destination point to
draw the line.  This I understand.  Now I need to moveTo() a starting
point and draw the text, not a straight line.

On the next page we have the path constructors in Table 10.1.  Looking
at these constructors it looks like I need the moveTo() and the
Rectangle() but I couldn't figure out how to use both.  Then Table 10.2
gives the path painting operators.  The fill(), fillStroke(), eoFill(),
eoFillStroke() and newPath() operators could qualify but I'm not sure
which to use when.  The fill() operator is the one I tried and I didn't
get what I wanted.

Simply put, we need to overlay several table columns with text while
still showing all of the borders and coloring of the table columns under
the text.  In effect, this is like printing over a preprinted form, if
you catch my drift.

Regards, 
Mike Buchanan
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Bruno Lowagie
Sent: Thursday, January 18, 2007 10:10 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Overlay text across multiple table cells

Mike Buchanan wrote:
>         PdfContentByte cb = canvases[PdfPTable.TEXTCANVAS];
>         cb.moveTo(position.left(), position.top());
>         //cb.stroke();
>         cb.fill();

But where's the path?
What makes you believe this will actually draw something?
It just doesn't make sense...

> As you can see in the attachment it put the text below the table
instead 
> of overlaying it.

Of course! That's how you programmed it!

> Maybe a working example would be easier to understand.

Sigh...
The fact that you don't understand why you need to paint
a path before you STROKE or FILL it (as is clearly explained
in the book), and the fact that you throw away everything
that is already in the cell by using setPhrase, a method
that is NOT EVEN MENTIONED in the book, really gives me
the impression you are pulling my leg here, but against
better judgment, see the attachment for a working example
(of course I have no idea if that's actually what you want
to do; your original code was very unclear).
br,
Bruno

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to