Every time the printer driver prints a document it will also generate a ‘group file’. The group file contains useful information about the printed image(s) like the image format (TIFF, JPEG, etc.), color depth, number of pages, and the name and full path of the generated image files.
An application can read the group file and processes the generated output files (copy, move, rename, etc).
The OutputFileName sample included in the Printer Driver Resource Toolkit demonstrates how to get the name of the output image file from the group file.
The Resource Toolkit also contains the full source code of the sample written in Visual C++, C# and VB.NET