pdf.CloseDocument(id)
Note that this function must only be used for documents opened using pdf.OpenDocument(). Documents created using pdf.CreateDocument() must be freed using the doc:Free() method.
Also note that pdf.CloseDocument()
must not be called before all vector brushes
obtained via pdf.GetBrush() from the document have been freed.