You would first need to understand the structure of a print document, and then find some way of identifying the transaction (or other) values inside that content. There may be a way of doing it through the
Print Spooler API Functions (Windows)[
^]. Alternatively you need to write a device filter to the printer and capture the data as it is sent to the driver. Neither of these is a simple solution.