Due to an unfortunate bug in Java’s implementation of memory-mapped files (view JDK bug entry), it is possible that a PDF file opened and processed by PDFTextStream will remain locked even after the PDFTextStream instance’s close() function has been called, and PDFTextStream has released all of the filesystem handles it has allocated. This locking behaviour (which is known to occur only on Windows) will prevent the PDF file from being deleted or moved until Java’s garbage collector eliminates certain JDK-internal objects that are used to track and manage the previously memory-mapped PDF file.
The solution in this case is to force PDFTextStream to not memory map source PDF files. This is done by setting the pdfts.mmap.enable system property to N, or by setting the memory mapping property in com.snowtide.pdf.PDFTextStreamConfig to false. For details on how to set system properties for PDFTextStream, please refer to the appropriate appendix in the Developer's Guide (available in all PDFTextStream downloads, or here).
(Note that in PDFTextStream releases prior to v2.2.0, pdfts.mmap.disable was used as the key system property; starting with v2.2.0, pdfts.mmap.disable was removed, and replaced with the pdfts.mmap.enable property.)