RequestPrinterStatus
רינדור והדפסה
תיאור
השתמשו בפונקציה זו כדי להפעיל מערכת הדפסה חלופית שמאפשרת לקבל את מצב המדפסת. חלק גדול מקודי המצב שמוחזרים מסופקים על ידי מנהל ההתקן של המדפסת; אין ערובה שהערכים יכילו מידע משמעותי עבור כל המדפסות
הצעד הראשון הוא לקרוא לפונקציה זו עם StatusCommand=101 כדי להפעיל ניטור מצב המדפסת. לחלופין, אפשר להתחיל את עבודת ההדפסה במצב מושהה על ידי קריאה נוספת לפונקציה זו עם StatusCommand=103. זה עשוי להיות נחוץ עבור עבודות הדפסה קטנות שאחרת היו מסתיימות לפני שניתן לקרוא את המצב
אז אפשר להתחיל את עבודת ההדפסה כרגיל עם אחת מפונקציות ההדפסה: PrintDocument, PrintDocumentToFile או
PrintDocumentToPrinterObject.
לאחר שעבודת ההדפסה התחילה אפשר לקרוא לפונקציה זו שוב ושוב לאחזור מצב המדפסת עבור עבודת ההדפסה לאורך זמן; אם עבודת ההדפסה הופעלה במצב מושהה, ההדפסה בפועל תתחיל רק כאשר הפונקציה נקראת עם StatusCommand=402
תחביר
Delphi
Function TPDFlib.RequestPrinterStatus(StatusCommand: Integer): Integer;
ActiveX
Function PDFlib::RequestPrinterStatus(StatusCommand As Long) As Long
DLL
int DLRequestPrinterStatus(int InstanceID, int StatusCommand);
פרמטרים
| StatusCommand | 100 = Turn off printer status monitoring. 101 = Turn on printer status monitoring. 102 = Returns 1 if printer status monitoring is active. 103 = Start print job in paused state. 104 = Start printing immediately. 105 = Returns 1 if print job will be started in paused state. 200 = Returns 1 if print job data exists. 201 = Returns the Windows Spooler JobID. 202 = Returns the job priority, from 1 to 99. 203 = Returns the job's position in the print queue. 204 = Returns the total page count. 205 = Returns the number of pages that have been printed. This is usually zero if the data type is "RAW". 206 = Returns the number of milliseconds since the print job was started. 207 = Returns the print job data type Returns 1 if the data type contains "RAW" Returns 2 if the data type contains "EMF" Returns 3 if the data type contains "TEXT" Returns 4 if the data type contains "XPS" 300 = Returns the encoded job status. 301 = Returns 1 if the job is paused. 302 = Returns 1 if there is an error. 303 = Returns 1 if the job is being deleted. 304 = Returns 1 if the job is spooling. 305 = Returns 1 if the job is printing. 306 = Returns 1 if the printer is offline. 307 = Returns 1 if the printer is out of paper. 308 = Returns 1 if the job has printed. 309 = Returns 1 if the job has been deleted. 310 = Returns 1 if the driver cannot print the print job. 311 = Returns 1 if the printer has an error that requires the user to do something. 312 = Returns 1 if the job has been restarted. 313 = For Windows XP and later, returns 1 if the job has been sent to the printer (job may not be printed yet). 314 = For Windows Vista and later, returns 1 if the job has been retained in the print queue and cannot be deleted. 401 = Pause the print job. 402 = Resume a paused print job. 403 = Delete the print job. |
|---|