There’s a customizable printer driver in the LEADTOOLS Virtual Printer SDK. (Disclosure: I work for LEADTOOLS vendor).
This forum post contains a C# demo project that uses the printer driver events to intercept print jobs and save them as PDF.
To parse the printed page text, I modified that project’s EMF event, which is triggered for every page in the print job, and obtained plain text from the page using the following code:
// Printed pages event
private static void Printer_EmfEvent(object sender, EmfEventArgs e)
{
DocumentWriter tempDocWriter = new DocumentWriter();
MemoryStream memoryStream = new MemoryStream();
tempDocWriter.BeginDocument(memoryStream, DocumentFormat.Text);
using (Metafile metaFile = new Metafile(e.Stream))
tempDocWriter.AddPage(new DocumentWriterEmfPage()
{
EmfHandle = metaFile.GetHenhmetafile()
});
tempDocWriter.EndDocument(); // Save the page as TEXT format into the stream
memoryStream.Position = 0;
StreamReader streamReader = new StreamReader(memoryStream);
string pageText = streamReader.ReadToEnd();
//Now the string can be parsed
}
Regarding OCR, the toolkit also contains an OCR engine that can be used to convert image-based print jobs to text.
If you would like to try the SDK, there’s a free evaluation edition on this page.