title: How to check that the document has no pages
body: <p>I am trying to use iTextSharp to convert some HTML mail from Outlook into PDF. Some mail gives problem to the <code>HTMLWorker</code>, generating exceptions.</p>
  
  <p>In case this happens, I want to catch the exception and abandon the PDF creation. But I can not. What do I have to do to check and properly close the opened <code>Document</code>?</p>