Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
QuestionHow to get bytes of printed file using Win32_PrintJob Pin
Wahyu Hidayat29-Nov-08 10:53
Wahyu Hidayat29-Nov-08 10:53 
AnswerRe: How to get bytes of printed file using Win32_PrintJob Pin
0x3c029-Nov-08 23:34
0x3c029-Nov-08 23:34 
GeneralRe: How to get bytes of printed file using Win32_PrintJob Pin
Wahyu Hidayat1-Dec-08 16:12
Wahyu Hidayat1-Dec-08 16:12 
GeneralRe: How to get bytes of printed file using Win32_PrintJob Pin
Wahyu Hidayat1-Dec-08 19:06
Wahyu Hidayat1-Dec-08 19:06 
GeneralRe: How to get bytes of printed file using Win32_PrintJob Pin
0x3c01-Dec-08 20:13
0x3c01-Dec-08 20:13 
GeneralRe: How to get bytes of printed file using Win32_PrintJob Pin
Wahyu Hidayat4-Dec-08 5:57
Wahyu Hidayat4-Dec-08 5:57 
GeneralRe: How to get bytes of printed file using Win32_PrintJob Pin
0x3c04-Dec-08 9:59
0x3c04-Dec-08 9:59 
GeneralRe: How to get bytes of printed file using Win32_PrintJob Pin
Wahyu Hidayat6-Dec-08 5:15
Wahyu Hidayat6-Dec-08 5:15 
I've tried your code. When I executing the return q.GetJob(i);, it apprears error :
"An exception occurred while creating print job information. Check inner exception for details."

I search the inner exception, and found "Object reference not set to an instance of an object."

In my previous code:
private PrintSystemJobInfo GetInfo()
{
LocalPrintServer localPrintServer = new LocalPrintServer();
PrintQueue q = LocalPrintServer.GetDefaultPrintQueue();
q.Refresh();
foreach (PrintSystemJobInfo pj in q.GetPrintJobInfoCollection())
{
return pj;
}
return null;
}

PrintSystemJobInfo pj = GetInfo();

From pj I can get the printing information such as DocumentName and NumberOfPage. But when I try to get value from of JobStream, the error "Object reference not set to an instance of an object." apprears. Seems that the value of stream is null.
GeneralRe: How to get bytes of printed file using Win32_PrintJob Pin
0x3c07-Dec-08 3:23
0x3c07-Dec-08 3:23 
Questionre Code Pin
mutafa8129-Nov-08 10:41
mutafa8129-Nov-08 10:41 
AnswerRe: re Code Pin
Pete O'Hanlon29-Nov-08 10:47
mvePete O'Hanlon29-Nov-08 10:47 
GeneralRe: re Code Pin
Paul Conrad29-Nov-08 13:48
professionalPaul Conrad29-Nov-08 13:48 
AnswerRe: re Code Pin
PIEBALDconsult29-Nov-08 15:12
mvePIEBALDconsult29-Nov-08 15:12 
GeneralRe: re Code Pin
Thomas Weller29-Nov-08 17:51
Thomas Weller29-Nov-08 17:51 
GeneralRe: re Code Pin
Paul Conrad30-Nov-08 6:38
professionalPaul Conrad30-Nov-08 6:38 
AnswerRe: re Code Pin
Christian Graus29-Nov-08 15:26
protectorChristian Graus29-Nov-08 15:26 
GeneralRe: re Code Pin
Thomas Weller29-Nov-08 17:57
Thomas Weller29-Nov-08 17:57 
GeneralRe: re Code Pin
Christian Graus29-Nov-08 18:13
protectorChristian Graus29-Nov-08 18:13 
GeneralRe: re Code Pin
Thomas Weller29-Nov-08 18:24
Thomas Weller29-Nov-08 18:24 
AnswerRe: re Code Pin
Thomas Weller29-Nov-08 18:07
Thomas Weller29-Nov-08 18:07 
GeneralRe: re Code Pin
Paul Conrad30-Nov-08 6:29
professionalPaul Conrad30-Nov-08 6:29 
AnswerRe: re Code Pin
MickCurley30-Nov-08 0:34
MickCurley30-Nov-08 0:34 
QuestionA problem with System.Drawing.Drawing2D Pin
Pedram Behroozi29-Nov-08 9:48
Pedram Behroozi29-Nov-08 9:48 
GeneralRe: A problem with System.Drawing.Drawing2D Pin
Luc Pattyn29-Nov-08 10:46
sitebuilderLuc Pattyn29-Nov-08 10:46 
GeneralRe: A problem with System.Drawing.Drawing2D Pin
Guffa29-Nov-08 20:44
Guffa29-Nov-08 20:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.