I am using --headless mode and want to close the document.
Basically I am wanting to extract the text from the document, and take a preview image of the doc.
So for example a docx would be loaded, image taken, txt file written, then document closed so another document can be loaded in its place and the process repeated.