I haven't tried it but it appears you need these Windows API functions: OpenPrinter, SetPrinter, ClosePrinter.
The constant PRINTER_CONTROL_PURGE is 3. The call to SetPrinter would be:
lb_result = SetPrinter(ll_handle, 0, 0, PRINTER_CONTROL_PURGE)
https://msdn.microsoft.com/en-us/library/windows/desktop/dd145082(v=vs.85).aspx