Questions tagged [printqueue]

45 questions
10
votes
6 answers

Access Denied trying to purge printqueue in C#

I'm trying to make a method in C# that empties all items in a print queue. Below is my code: LocalPrintServer localPrintServer = new LocalPrintServer(PrintSystemDesiredAccess.AdministratePrinter); PrintQueue printQueue =…
Kris
  • 514
  • 3
  • 6
  • 19
6
votes
2 answers

System.Printing.PrintQueue QueueStatus not updating

Is there a way to update the print queue status information contained in the PrintQueue object? I've tried calling Refresh on the PrintQueue object but that doesn't really do anything. For instance, I've turned off the printer and the Control Panel…
Mike Dinescu
  • 54,171
  • 16
  • 118
  • 151
6
votes
2 answers

Network printers and the PrintServer.GetPrintQueues method

I have a feeling that the PrintServer.GetPrintQueues method does not return the network printers. If this one is true, what other choices do i have?
OrElse
  • 9,709
  • 39
  • 140
  • 253
4
votes
2 answers

Sending raw ZPL to Zebra printer via PrintServer is not working

Problem I am trying to send zpl RAW to print server. There is a Zebra ZM400 printer. I could get PrintServer, PrintQueue objects. Also, I could add a job, and write to its JobStream. I checked print queue (on Windows), and the document was sent.…
Gustavo
  • 41
  • 1
  • 3
4
votes
2 answers

get print queue details for a shared printer

Am trying to print a document on a shared printer; i need to get print queue details.The following code always gets queue from 'Microsoft XPS Document' as Number of jobs=0.But my default printer is configured as 'HP LaserJet P1505n' …
Murali Uppangala
  • 884
  • 6
  • 22
  • 49
2
votes
1 answer

PrintQueue is the printer the default printer?

I'm making my own dialog for printing in my application, now I have this code to put all the printers in a combobox: PrintServer server = new PrintServer(); foreach (PrintQueue queue in server.GetPrintQueues()) { …
Sander Declerck
  • 2,455
  • 4
  • 28
  • 38
2
votes
1 answer

WPF Printing : Unable to get printer supported PageMediaSize

I am working on WPF application and facing some issues in Printing. PrintQueue.GetPrintCapabilities().PageMediaSizeCapability collection doesn’t having all PageMediaSize supported by printer. I am using hp officejet 7610 driver (which supports A3…
sudhakar c
  • 21
  • 1
2
votes
1 answer

PrintSystemJobInfo.TimeJobSubmitted Reports Wrong Time?

The TimeJobSubmitted attribute does not appear to return the time in the correct Time Zone. When I manually look at the Print Queue in Windows, I can see that the time is correct on the job. (Example: Displays Job1 submitted at 3:30); The issue is…
clamchoda
  • 4,411
  • 2
  • 36
  • 74
2
votes
0 answers

Attempt by security transparent method with printer

I'm writing an application in C# that allows to clear default's printer queue. In order to do so I have such piece of code : String spoolDir = "C\\Windows\\System32\\spool\\PRINTERS"; System.IO.DirectoryInfo dir = new…
2
votes
1 answer

Printing through PrintQueue job in ASP.NET MVC fails with 0 byte size printed file

I tried this example from MSDN in an ASP.NET MVC project: public void Print(string printQueueName, string printData) { PrintQueue printerQueue = new LocalPrintServer().GetPrintQueue(printQueueName); // Call AddJob …
AlBaraa Sh
  • 2,202
  • 3
  • 20
  • 29
2
votes
0 answers

PrintQueueStatus returns None, printer is already turned off

I already turned off the printer, and my code still returns None Here is my code try { printServer.Refresh(); PrintQueue printQueue = new PrintQueue(printServer, cmbPrinters.Text.Trim()); printQueue.Refresh(); if…
SHINHAN
  • 685
  • 2
  • 12
  • 28
1
vote
0 answers

Lexmark MS621 printer won't give me JobInfoCollection nor PrintQueue statuses

I'm trying to write an app that prints periodically. I've developed the app and I tested it with my HP Photosmart B110a printer and everything works fine, but on this next printer, which is a Lexmark MS621 I don't get anything back from…
1
vote
1 answer

PrintQueue.Refresh() throws error stating that "The calling thread cannot access this object because a different thread owns it"

I'm trying to make a Windows service that prints, but it seems like I got stuck on refreshing a PrintQueue.It says a different thread owns the object. Here is the error I get at System.Windows.Threading.Dispatcher.VerifyAccess() at…
1
vote
2 answers

Events in PrintQueue

ps = new PrintServer(printserverName); PrintQueue pq1 = new PrintQueue(ps, pq.Name); As per my understanding, pq1 is a printer Queue which will handle print jobs. I want to catch events for this print queue. For example, if user A gives a print…
Ashutosh
  • 71
  • 1
  • 5
1
vote
0 answers

Java PDF Box Print first time long in queue

I have a small Java programm, in which I generate a Pdf and later I print the PDF with the PDF Box tool an the Java Printer Job. I use a brother label printer. When I press the button to execute the print method, windows open the printer queue and…
1
2 3