I just looked through some code (had a couple of minutes). It looks like PdfWriter implements IDisposable (or at least the IDocListener, which, if you go far down, inherits PdfWriter). You just need to call Dispose () (or wrap it in a using statement):
using(PdfWriter MyWriter=PdfWriter.GetInstance(Document,Stream))
{
...
}
The same with most of the rest (Document, etc.). Although this only looks like newer versions (version 4.0 in one of my projects doesn't seem to use IDisposable for PdfWriter, etc.)
source
share