Hello, I just answered to a mail by Matt Benson on the mailing list. Your planned changes will interest him too. Maybe you can discuss design choices together.
Markus Pallo writes: > On Tuesday 19 February 2002 16:55, you wrote: >> Markus Pallo writes: >> > ok, following idea to do this. (i will program it, if you like) >> > >> > If i understand right, its only possible to add lines and text (fixed >> > positioned) to the PdfContentByte. >> >> No there is also the very simple Graphic object which extends >> PdfContentByte. > > ah yep, i have not seen.... > >> >> > I will get all DocumentListeners and call the correct methods on the >> > DocumentListeners which are instanceOf PdfWriter of the document. >> > For this i need to add a method get DocumentListeners on Document. >> >> Yes and that's not very elegant. >> I think it would be better if SAXiTextHandler only had >> to add objects to the Document object and if there was >> no 'writer'-object involved. >> >> > itext.dtd will get new Elements "dc" means directContent >> > <!ELEMENT dclineTo EMPTY> >> > <!ATTLIST dclineTo >> > fromx CDATA #REQUIRED >> > fromy CDATA #REQUIRED >> > tox CDATA #REQUIRED >> > toy CDATA #REQUIRED >> > >> > <!ELEMENT dcshowText #PCDATA> >> > <!ATTLIST dcshowText >> > %font.attributes; >> > absolutex CDATA #REQUIRED >> > absolutey CDATA #REQUIRED >> >> Since these are rather simple operations, I would try >> to perform this using the Graphic object. >> >> Otherwise you will have problems with applications >> generating HTML at the same time PDF is generated. >> You will try to get a PdfContentByte-object from a >> writer that doesn't has a getDirectContent-method. > > ok, this means, i need to add a Graphic Element to the Document. > I extend Graphic and add there something like drawText and setText the line > feature is still existing there. Horizontal Line. Probably we will add > drawLine also ? > > Then i add in processAttributes the calls of drawXXXX, ignoring the positions. > > And how the names should be inside the dtd, for the line and text ? > drawHorizontalLine, drawLine, showText ? > > This is a solution which i like... > >> If you use the Graphic object, it will simply be >> ignored by other writers... >> >> As soon as I find the time I will look if it's possible >> to use the Graphic object for text. Using it for lines >> is very simple... > > for text also i think, have to add the methods and can use all function from > PdfContentByte inside.... setTextMatrix and showText....... Yes, but be carefull not to change the textmatrix of the rest of the document. This would lead to some very odd results. I think you would better use a PdfTemplate inside the Graphic object. Bruno _______________________________________________ iText-questions mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/itext-questions
