If you are writing the file to disk first then perhaps you could try using PC_PRINT_FILE instead of the printer redirection shown in the example which is really for writing your print line directly to the printer.
The example uses esc codes that are for a specific printer that is used in the example. You would have to replace these with codes that are applicable to your own printer if they are indeed different.
Thanks,