Hi Paulo,
I even had to make it more ugly, because generic tags are always triggered
before cellevents. At the time of the generic tag I don't have the
rectangle values of the cellevent. In order to get it running properly I
had to mess around with additonal generic tags after the first and after
the last cellevent. But now enough of developer scaring :)
Maybe I will remove the whole cellevent stuff and do it only with generic
tags to get rid of the additonal tags.
Thanks again for your help.
Best Regards
Benjamin
Paulo Soares <[EMAIL PROTECTED]>
29.09.2008 12:46
Bitte antworten an
Post all your questions about iText here
<itext-questions@lists.sourceforge.net>
An
Post all your questions about iText here
<itext-questions@lists.sourceforge.net>
Kopie
Thema
Re: [iText-questions] Antwort: Re: Antwort: Antwort: Re: PdfPCellEvent and
Pagebreak Problem
The last even triggered requirement changes everything and it can't be
done without changing iText. A (ugly) workaround is to have a generic tag
event placed in the last char of the last paragraph to mark the validity
of the cell event.
Paulo
> -----Original Message-----
> From: Benjamin Rein [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 29, 2008 10:55 AM
> To: Post all your questions about iText here
> Subject: [iText-questions] Antwort: Re: Antwort: Antwort: Re:
> PdfPCellEvent and Pagebreak Problem
>
>
> Hi Paulo,
>
> the problem is that I don't need the cell coordinates of the
> first triggered event of each cell, but the coordinates of
> the last event triggered for each cell. These two can be the
> same if the cell fits completely on one page. I should have
> made this requirement clear in the beginning...
>
> My problem is that I don't know if the current triggered
> event is the last one for this cell or not. I've already
> thought about several approaches to deal with the problem:
>
> 1. Use the ColumnText object of the PdfPCell inside the
> cellLayout method to gather the neccessary information. >
> It's only possible to recognise a pagebreak. But you don't
> know if the remaining text in the readonly ColumnText object
> fits the current page or not. Return value of inner ct.go()
> method is not accessible.
>
> 2. The cellevent should only be used to collect the
> coordinates of every event. After that just use the
> coordinates which were added last for every cell. > Problem
> here is that after all events were triggered I can only write
> to the last i.e. current page of the document. Am I missing
> something here?
>
> 3. Calculate the space that is needed by the cell and guess
> on which page i.e. count of event releases the last line will
> be printed. > I haven't tried that one yet, because it seems
> to unpredictable to me (pagebreaks done by iText have to be
> taken into account).
>
> Do you or anyone else has another hint for me? Thanks in advance.
>
> Best Regards
> Benjamin
>
>
>
> Paulo Soares <[EMAIL PROTECTED]>
>
> 26.09.2008 15:40
> Bitte antworten an
> Post all your questions about iText here
> <itext-questions@lists.sourceforge.net>
>
> An
> Post all your questions about iText here
> <itext-questions@lists.sourceforge.net>
> Kopie
> Thema
> Re: [iText-questions] Antwort: Antwort: Re: PdfPCellEvent and
> Pagebreak Problem
>
>
>
>
>
>
> I'm not sure I can see a problem here. Have a variable in
> your code to keep track of the number of times the event was
> called. If it's the second time just ignore.
>
> Paulo
>
> > -----Original Message-----
> > From: Benjamin Rein [mailto:[EMAIL PROTECTED]
> > Sent: Friday, September 26, 2008 1:22 PM
> > To: Post all your questions about iText here
> > Subject: [iText-questions] Antwort: Antwort: Re:
> > PdfPCellEvent and Pagebreak Problem
> >
> >
> > I just made a mistake in my last response. If
> > cell.getColumn().getLinesWritten() == 0 there was no
> > pagebreak. There was a pagebreak when
> > cell.getColumn().getLinesWritten() returns a value != 0. The
> > value returned is the line count which was written from the
> > content of the PdfPCell on the page before.
> >
> > Best Regards,
> > Benjamin Rein
> >
> >
> >
> > Benjamin Rein <[EMAIL PROTECTED]>
> >
> > 26.09.2008 14:11
> > Bitte antworten an
> > Post all your questions about iText here
> > <itext-questions@lists.sourceforge.net>
> >
> > An
> > Post all your questions about iText here
> > <itext-questions@lists.sourceforge.net>
> > Kopie
> > Thema
> > [iText-questions] Antwort: Re: PdfPCellEvent and Pagebreak Problem
> >
> >
> >
> >
> >
> >
> >
> > Hi Paulo,
> >
> > thanks for your fast reply. The idea is good, but the
> > realisation is not that easy. At the moment I can recognize
> > the first pagebreak with cell.getColumn().getLinesWritten()
> > == 0 inside the cellevent. If this condition is true, the
> > cell with the event and the paragraph within are at least
> > spanning two pages.
> >
> > I don't know any conditions for a cell which fits on one page
> > and for a cell that needs more than 2 pages. Somehow I have
> > to calculate the space the content inside the cell needs and
> > the page on which the cell ends. Could you please give me a
> > hint or an example for this? Thanks very much.
> >
> > Best Regards,
> > Benjamin Rein
> >
> >
> > Paulo Soares <[EMAIL PROTECTED]>
> >
> > 26.09.2008 13:27
> >
> > Bitte antworten an
> > Post all your questions about iText here
> > <itext-questions@lists.sourceforge.net>
> >
> > An
> > Post all your questions about iText here
> > <itext-questions@lists.sourceforge.net>
> > Kopie
> > Thema
> > Re: [iText-questions] PdfPCellEvent and Pagebreak Problem
> >
> >
> >
> >
> >
> >
> >
> >
> > What prevents you to ignore the other calls in your
> > PdfPCellEvent implementation?
> >
> > Paulo
> >
> > > -----Original Message-----
> > > From: Benjamin Rein [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, September 26, 2008 11:16 AM
> > > To: itext-questions@lists.sourceforge.net
> > > Subject: [iText-questions] PdfPCellEvent and Pagebreak Problem
> > >
> > >
> > > Hi everyone,
> > >
> > > I'm using a PdfPCellEvent to get the Y coordinate after
> > > adding a Paragraph wrapped in a PdfPCell to a PdfPTable. With
> > > the Y coordinate I write some other stuff using ColumnText on
> > > the right side of the column where the Paragraph is added. If
> > > the Paragraph fits on one page everything is working fine.
> > >
> > > If the Paragraph spans multiple pages the event is called
> > > once for every page the Paragraph is printed on (e.g.
> > > Paragraph spans 3 pages. Event is called 3 times). This
> > > absolutely makes sense for creating custom cell borders and
> > > the like. But I need to have the event called only once for
> > > every Paragraph ignoring the number of pages which the
> > > Paragraph needs to be completely displayed. Is there any
> > > chance to achieve this with PdfPCellEvent or should I rather
> > > use something else?
> > >
> > > Thanks in advance.
> > >
> > > Best Regards,
> > > Benjamin Rein
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão
desta mensagem não significa a perca de confidencialidade. Se esta
mensagem for recebida por engano, por favor envie-a de volta para o
remetente e apague-a do seu sistema de imediato. É proibido a qualquer
pessoa que não o destinatário de usar, revelar ou distribuir qualquer
parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may
contain confidential or legally protected information. The incorrect
transmission of this message does not mean the loss of its
confidentiality. If this message is received by mistake, please send it
back to the sender and delete it from your system immediately. It is
forbidden to any person who is not the intended receiver to use,
distribute or copy any part of this message.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
____________________________________________________________________
Viessmann IT Service GmbH
Geschäftsführer: Dirk Klöckner, Dr. Harald Dörnbach
Sitz der Gesellschaft: Allendorf (Eder) - Registergericht:
AG Marburg (Lahn) - HRB 5324 - USt-IdNr.: DE258558424
____________________________________________________________________
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php