Results 1 to 4 of 4

Thread: [RESOLVED] [2008] Printer - jobstream property null reference exception

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2007
    Posts
    70

    Resolved [RESOLVED] [2008] Printer - jobstream property null reference exception

    Hi,

    I am trying to make a program that retrieves data from print jobs. The name, job size etc works but when I attempt to read the jobstream length I get a null reference exception.


    Code:
     q = LocalPrintServer.GetDefaultPrintQueue
            For Each pj In q.GetPrintJobInfoCollection
                MsgBox(pj.Name)
                MsgBox(pj.JobSize)
                MsgBox(pj.JobStream.Length)
            Next

  2. #2
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: [2008] Printer - jobstream property null reference exception

    You can't read a print job raw data from all printers - only those that suport bidirectional interface - so the PrintJob.JobStream can be null.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2007
    Posts
    70

    Re: [2008] Printer - jobstream property null reference exception

    Is there another way to be able to read the raw data from print jobs?

  4. #4
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: [2008] Printer - jobstream property null reference exception

    Yes - set the printer to keep printed documents after they are printed and then parse the spool file...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width