Recent

Author Topic: Problem with printing using WSD port  (Read 1780 times)

domasz

  • Hero Member
  • *****
  • Posts: 554
Problem with printing using WSD port
« on: September 09, 2023, 07:43:18 pm »
My application is printing just fine on printers I tested but one user informed me it doesn't print on his printer which uses WSD port. All other programs he has print just fine.

I am not doing anything fancy, just:
Code: Pascal  [Select][+][-]
  1.  if PrintDialog1.Execute then begin
  2.     Printer.BeginDoc ;
  3.     //drawing on Printer.Canvas
  4.     Printer.EndDoc;
  5. end;

The user says the document shows in the printer queue but the printer is not activated. How can I fix that?

rvk

  • Hero Member
  • *****
  • Posts: 6655
Re: Problem with printing using WSD port
« Reply #1 on: September 09, 2023, 07:56:22 pm »
If it ends up in the queue then it's out of your hands.
It's up to Windows.

The other printer driver could sent Invalid commands.
The printer might be offline.
Is the printerdriver waiting for certain paper?
Did the user restart the computer?
Etc.

Does the job stay in the print queue?
If it does, what status does it have?
« Last Edit: September 09, 2023, 07:59:30 pm by rvk »

domasz

  • Hero Member
  • *****
  • Posts: 554
Re: Problem with printing using WSD port
« Reply #2 on: September 09, 2023, 08:07:02 pm »
Thanks, I will ask for more info.
The user isn't an idiot so I assume the printer must be online and there must be paper in.

MichaelBM

  • New Member
  • *
  • Posts: 38
Re: Problem with printing using WSD port
« Reply #3 on: September 10, 2023, 09:32:33 am »
I had the same problem and this soldved it:

Code: Pascal  [Select][+][-]
  1. if PrintDialog1.Execute then begin
  2.   Printer.Refresh;
  3.   Printer.BeginDoc ;
  4.   //drawing on Printer.Canvas
  5.   Printer.EndDoc;
  6. end;
"Everything must be made as simple as possible. But not simpler.”

rvk

  • Hero Member
  • *****
  • Posts: 6655
Re: Problem with printing using WSD port
« Reply #4 on: September 10, 2023, 09:44:45 am »
I had the same problem and this soldved it:
If Printer.Refresh helps this could be due to a very old bug in Windows 10 from 2016.

It shouldn't be there anymore, unless the user is running a very old unpatched system or the bug is reintroduced.

https://forum.lazarus.freepascal.org/index.php/topic,33815.msg220349.html#msg220349

But back then it did print one copy. I didn't see that mentioned here.
But it is useful to check these things (adding refresh, asking if one copy printed, etc).

Printer name and OS (and if updated to latest) is useful information too.


 

TinyPortal © 2005-2018