In the Javadoc for Document.newPage(), it says iText throws a
DocumentException if newPage() is called on a closed document. My unit tests
cannot reproduce this behavior. 

Moreover the source code from Document.java indicates that if the document
is closed, you simply return without throwing any exception. Here is the
iText code, as downloaded today:

/**
 * Signals that an new page has to be started.
 *
 * @return <CODE>true</CODE> if the page was added, <CODE>false</CODE>
 *         if not.
 * @throws DocumentException
 *             when a document isn't open yet, or has been closed
 */
    
    public boolean newPage() throws DocumentException {
        if (!open || close) {
            return false;
        }
        DocListener listener;
                for (Iterator iterator = listeners.iterator(); 
iterator.hasNext();) {
            listener = (DocListener) iterator.next();
            listener.newPage();
        }
        return true;
    }

Am I missing something? If not, could we throw the exception (my preference)
or get rid of it; and either way, update the Javadoc?

Many thanks for this, as well as for a fine library and a terrific book
(which is now available in the US).

---Andrew Binstock

-- 
View this message in context: 
http://www.nabble.com/Documentation-error-in-newPage%28%29---tf3130142.html#a8672965
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
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
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to