We have a case where it does not throw an exception, and one of the
listeners returns false...
The only listener is an instance of PdfDocument, and adding a new page
returns false because of this clause in PdfDocument.newPage():
if (writer.getDirectContent().size() == 0 &&
writer.getDirectContentUnder().size() == 0 && (pageEmpty || (writer != null
&& writer.isPaused()))) {
return false;
}
This is of course because we previously have made an error adding to the
document, but if Document.newPage() returned false we could discover earlier
on that we had made a mistake. Now, we will get an exception calling
Document.close().
Best regards,
Jan
"Paulo Soares" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Don't worry with the result. If it fails it will throw an exception.
Best Regards,
Paulo Soares
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Jan Bentzen
> Sent: Wednesday, April 14, 2004 12:46 PM
> To: [EMAIL PROTECTED]
> Subject: [iText-questions] Potential bug: Document.newPage()
> ignores results of its listeners
>
> The call to Document.newPage() forwards the request to its
> listeners, but
> the result of the listeners newPage() call is ignored:
>
> DocListener listener;
> for (Iterator iterator = listeners.iterator();
> iterator.hasNext(); ) {
> listener = (DocListener) iterator.next();
> listener.newPage(); // <-- Result is ignored!
> }
> return true;
>
> Is this a bug? Shouldn't it honour the results of its
> listeners, like in
> Document.add(Element)?
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> iText-questions mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=ick
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions