Wow, there was a lot of discussion on this today...I'll just throw out some responses to points Jim made in case any of it is useful:
> Right now, though the drawing target has changed to a template, the rest is > still based around a document and writer (required in constructor). Maybe it > makes sense to move the whole thing over to a template base like Jeremy's. > What are everyone's thoughts? I generally like to provide as little information as possible to a constructor...helps allow use in unforeseen circumstances and makes the code using it simpler. And you can call getPdfWriter() on the template, and getPdfDocument() on that writer, so I don't really see the need to pass them explicitly even if they are needed. > As for clipping, this seems to do the trick without templates. I don't know > enough about the internals of the saveState()/restoreState() calls to know > what other side effects this causes, though. This is what I tried first, but it generated invalid PDF files more often than not. I may well have been missing some subtleties of the state management functions, but I've had best luck just avoiding state saves and restores altogether. > Actually, I think we are almost there. If I implement the stuff from your > code (copyArea and the GraphicsConfigration stuff), then all I believe we > are missing now is setXORMode(Color c) which I don't believe is doable with > pdf. (I could have used you and your book when trying to figure out the > AffineTransformations--it works now, but I was pulling my hair out for a > couple of days there). My copyArea() actually doesn't work...what's there was a first attempt, and I moved on when it didn't work properly since none of the code I've seen uses it. It may serve as a starting point for something that does work, though; haven't played with it enough to tell. I'm pretty sure XOR mode isn't feasible; it seems fundamentally incompatible with vector graphics. Jeremy _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions