0

Addition to my question here : How to catch printing jobs

I managed to catch PrintSystemJobInfo objects, created when a print job enters a queue by using following code:

public static void WritePrinterJobs()
    {
        List<PrintSystemJobInfo> jobInfos = new List<PrintSystemJobInfo>();

        LocalPrintServer server = new LocalPrintServer();

        while (true)
        {
            foreach (var jobInfo in server.DefaultPrintQueue.GetPrintJobInfoCollection())
            {
                Console.WriteLine(jobInfo.JobName);
            }

        }
    }

Now, I want to read contents of a barcode being printed. Is there a way to do that?

Community
  • 1
  • 1
Mert Akcakaya
  • 3,109
  • 2
  • 31
  • 42
  • You could likely use the PrintSystemJobInfo.JobStream property to get the print job stream though I'm not sure what the format of that stream is. – Ian Dallas Apr 20 '12 at 06:45
  • I tried to do that but it returned a null reference. Are you sure the JobStream is the way to go? – Mert Akcakaya Apr 20 '12 at 06:48

1 Answers1

1

I found a solution. Reading printing documents using C# and .NET seems very painful and there is no easy way(now).

Some developer has a software called PrintMulti. You can find it here and it is also free! It just requires some documentation reading and doing some configurations. You can read contents, send the document to another printer and so on.. The software comes with documentation.

Mert Akcakaya
  • 3,109
  • 2
  • 31
  • 42
  • Thanks Mert for guiding in a right direction. I tried to use the task [ActionTextExtract] but no scccess. I did not see anything got extracted to the output text file. Did you get success in your case. Any hint on this will be a real help if you still remember. – bikram s. Aug 18 '12 at 08:46
  • Sorry, I don't remember those details but I can say that it worked for me. I can only tell you that it will most probably work if you do it right. – Mert Akcakaya Aug 30 '12 at 17:44