Long Printer Names.

Long Printer Names.

Postby byron.hopp » Thu Jul 21, 2016 4:38 pm

I have come across a problem that seems to exist in my fivewin apps. Sometimes when I specifically call out a printer by name:

Print oPrn cPrinterName

Sometimes this works fine, and other times the system displays a printer selection dialog as if the printer I asked for is not available on this workstation. I find this happens more often with using RDP with printer redirection. What I have found is that RDP appends additional characters to the print name. Example:

HP OfficeJet 9999 Mopier

This would be the name on the host RDP workstation.

HP OfficeJet 9999 Mopier (Redirected2)

This would be the name on the remote RDP workstation, RDP added the "(Redirected2)" to the printer name.

I believe it is the length of the printer name that causes the problem. I read somewhere that it is limited to 32 characters. However it is ok to create a printer with a name over 32 characters. Anybody had this same issue, and is there a way around it?

Thanks,

Byron ...
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Long Printer Names.

Postby Otto » Thu Jul 21, 2016 6:01 pm

Hello,
on printer redirection I use GetDefaultPrinter() - same on Bluetooth.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Long Printer Names.

Postby byron.hopp » Thu Jul 21, 2016 6:07 pm

Thanks for you response but I am not wanting the "Default Printer" I need the printer name that I have saved in the INI file. In my case the default printer is PDF995. The problem seems to be that the printer name I save in the ini will not be found when I call the "Print oPrn cPrintername" command, because the system does not find the printer based on the name I previously saved. I seems to be truncated so the strings are not exactly the same.

Byron ...
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Long Printer Names.

Postby dtussman » Thu Jul 21, 2016 8:35 pm

The Print command is really messed up in recent versions of FWH. In fact, in the command print oprn cprinter, as you described, cprinter is ignored completely. The only way to get that to work is to first set the windows default printer to the printer you want. This makes you think its working but its really not. I always set it back to what it was when I am done but this creates a whole set of other problems. For example, printer tray selections are not retained, etc.
dtussman
 
Posts: 97
Joined: Sat Jun 06, 2015 6:57 pm

Re: Long Printer Names.

Postby byron.hopp » Thu Jul 21, 2016 8:49 pm

Thank you dtussmen, and My apologies Otto, looks like this is what you were trying to tell me.

I'll play around with this and see.

Byron ...
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Long Printer Names.

Postby armando.lagunas » Thu Jul 21, 2016 9:39 pm

SkyPe: armando.lagunas@hotmail.com
Mail: armando.lagunas@gmail.com
User avatar
armando.lagunas
 
Posts: 346
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile

Re: Long Printer Names.

Postby Enrico Maria Giordano » Fri Jul 22, 2016 9:59 am

byron.hopp wrote:Print oPrn cPrinterName


The correct syntax is

Code: Select all  Expand view
Print oPrn TO cPrinterName


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Long Printer Names.

Postby dtussman » Fri Jul 22, 2016 4:08 pm

sorry, I was using the TO statement and regardless it still doesn't work. The only way you can get it to print to a specific printer is to change the windows default printer to the printer you want. Also, if you select a printer using the FROM USER statement the selection is not remembered, and the next time you go to print something using FROM USER it defaults back to the windows default printer. This all worked fine back in old versions of FWH.
dtussman
 
Posts: 97
Joined: Sat Jun 06, 2015 6:57 pm

Re: Long Printer Names.

Postby byron.hopp » Fri Jul 22, 2016 5:02 pm

Yes

Print oPrn Name cTitle to cWinPrinter

My internal manual has failed me. Happens more and more as I age...

I have it correct in my code.
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Long Printer Names.

Postby Enrico Maria Giordano » Fri Jul 22, 2016 5:39 pm

dtussman wrote:sorry, I was using the TO statement and regardless it still doesn't work. The only way you can get it to print to a specific printer is to change the windows default printer to the printer you want. Also, if you select a printer using the FROM USER statement the selection is not remembered, and the next time you go to print something using FROM USER it defaults back to the windows default printer. This all worked fine back in old versions of FWH.


Can you build a reduced and self-contained sample showing the problem, please?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Long Printer Names.

Postby dtussman » Thu Aug 04, 2016 9:30 pm

I finally identified the source of all my aggravation. In newer versions of FWH the ENDPRINT command sets the application printer back to the Windows default printer. In the old days this did not happen. It is possible to dispense with ENDPRINT and just use oprn:end(), but ENDPRINT seems to be necessary if doing a PREVIEW as otherwise the preview screen does not come up. I solved this by writing my own function that sets the printer back to the application printer after doing an ENDPRINT, but one shouldn't have to do this.
dtussman
 
Posts: 97
Joined: Sat Jun 06, 2015 6:57 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 104 guests