Link to home
Start Free TrialLog in
Avatar of jjackson2004
jjackson2004Flag for United States of America

asked on

why does using the copy /b command to download fonts to hp work in win98 but not xp

Situation is combining windows foxpro lan 2.0 and novell intranetware 4.11.  When I had to upgrade to Win98 years ago, I was able to get this to work with bindery only login.  Now on Win XP, this does not work.  Everything else about the code works except this code which downloads custom MICR fonts to the hp.  The p0setprn command sets console, off, sets output to printer, set printer on.

  IF mdl .OR. (malign .AND. mfirst)
    DO p0setprn WITH 'OFF','PRINTER','ON',0
    * ' Delete All fonts Currently in printer
    ** ! delfont
    * ' Id the font '
     * ' Bank Name Fonts'
    ??mesc+'*c' + mbfid1 + 'D'
    ! COPY /B &mbf1 prn >nul
    ?? mesc + '*c5F'

    ??mesc+'*c' + mbfid2 + 'D'
    ! COPY /B &mbf2 prn >nul
    ?? mesc + '*c5F'

    * ' Names'
    ??mesc+'*c' + mnfid1 + 'D'
    ! COPY /B &mnf1 prn >nul
    ?? mesc + '*c5F'

    ??mesc+'*c' + mnfid2 + 'D'
    ! COPY /B &mnf2 prn >nul
    ?? mesc + '*c5F'
    * ' Check Number '
    ??mesc + '*c' + mcfid + 'D'
    ! COPY /B &mckf prn >nul
    ?? mesc + '*c5F'

*\\ jjac 05/26/03
  IF mform = "ROFC"
    ??mesc + '*c' + mafid + 'D'
    ! COPY /B &maf1 prn >nul
    ?? mesc + '*c5F'
  Endif
*\\
*\\ jjac 09/28/04
  IF  mform = 'IDODEP'
    ??mesc+'*c' + mnfid1jj + 'D'
    ! COPY /B &mnf1jj prn >nul
    ?? mesc + '*c5F'
  Endif
*\\
    STORE TRIM(mmicrfont) TO mfstr
    ??mesc  + '*c' + mmid +'D'
    !COPY /B &mfstr prn >nul
    ?? mesc + '*c5f'
    * ' MICR Font'
    * ' Portrait or Landscape'
    * 'Evaluate for Landscape or Portrait Mode'
    STORE .F. TO mdl
  ENDIF                                          && mdl .OR. (malign AND. mfirst)

  DO p0setprn WITH 'ON','SCREEN','OFF',0


Tried variations of the copy command (ie  !copy &mfstr /b prn /b, etc), tried xcopy, tried 'type &mfstr > prn, tried replacing prn with lpt1.  NO luck.  Running out of time, and welcome any suggestions.

Thank you in advance for your assistance.

Avatar of elitehaxor
elitehaxor

windows 98 got everything to work, Xp,s copy command is not the same as XP,s copy command there are better 32bit copy programs out there try one of these to see if they alleviate the problem

hope that helps
Cheers
Avatar of jjackson2004

ASKER

have not been able to find a 'copy' replacement, so if you know of any, please let me know.
Avatar of giltjr
What is the problem?  Is that only text data makes it to the printer or that nothing goes to the printer?

Is it the same printer with the same level of print drivers?
The downloaded fonts are not making it to the printer
To print your files from dos
Put the .prn file somewhere where it is easy to find it.
Notice, if you saved your .prn file with a different printer, you might end with mess, because those files are specific for printer.
prn software will do away with that.

Go to the MS-DOS prompt and, if your file is in the Windows folder, at the C:\windows> prompt type:
copy yourdoc.prn LPT1 /B
This commend sends your file to printer for output.

Some software options for you

http://www.lerup.com/printfile/

http://www.gallicrow.co.uk/Imprint.html

http://www.eprintdriver.com/driver-features.html

http://aegisknight.org/print_to_pdf.html

http://www.jawspdf.com/pdf_creator/features.html

http://www.pstill.com/

Other Solutions :-

https://www.experts-exchange.com/questions/20515598/How-do-i-Print-with-a-prn-file.html?query=print+prn&searchType=topic
https://www.experts-exchange.com/questions/10317911/PRN-file.html?query=print+prn&searchType=topic

Hope this helps,
Had a similar problem with printing to a netware printers.

Solution was to use a virtual machine running windows 98.
The application ran in the windows 98 virtual machine.

The Windows XP printer driver model interferes with traditional
DOS printer commands.

VMWare is the VM of choice.

VMware Workstation
http://www.vmware.com/products/ws/

VMware Player (Free)
http://www.vmware.com/products/player/

VMWare Server (Free)
http://www.vmware.com/products/server/

There is also Virtual PC but has issues with resource use hopefully fixed with SP1.
http://www.microsoft.com/windows/virtualpc/default.mspx
Do you actullay have the priner associated with the device PRN or LPT1?

Under XP printers are NOT automatically associated with these names, especially if they are LAN attached.

If LAN attached, you need to do something like:

   NET USE LPT1 \\server\printername

Where server is the name of the printer server and printername is the printer.
(New problem at the end of this tome)

Thanks for all the suggestions.  Just read them this morning, since the Internet has been out down here in the tropics)  Working late into the night last night, I was able to come up with a solution to that immediate problem by modifying the code to capture the escape codes to a txt file and then copy the text files to the printer :

   if lc_ostype = "Windows_NT" (actually xp, but not being picky)

     * ' Bank Name Fonts'
    set alte to c:\temp\text1.txt
    set alte on
    ??mesc+'*c' + mbfid1 + 'D'
    set alte off
    set alte to c:\temp\text2.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text1.txt + &mbf1 + c:\temp\text2.txt prn >nul
*    ?? mesc + '*c5F'

    set alte to c:\temp\text3.txt
    set alte on
    ??mesc+'*c' + mbfid2 + 'D'
    set alte off
    set alte to c:\temp\text4.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text3.txt + &mbf2 + c:\temp\text4.txt prn >nul

*    ! COPY /B &mbf2 prn >nul
*    ?? mesc + '*c5F'

    * ' Names'
    set alte to c:\temp\text5.txt
    set alte on
    ??mesc+'*c' + mnfid1 + 'D'
    set alte off
    set alte to c:\temp\text6.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text5.txt + &mnf1 + c:\temp\text6.txt prn >nul
*    ??mesc+'*c' + mnfid1 + 'D'
 *   ! COPY /B &mnf1 prn >nul
 *   ?? mesc + '*c5F'

    set alte to c:\temp\text7.txt
    set alte on
    ??mesc+'*c' + mnfid2 + 'D'
    set alte off
    set alte to c:\temp\text8.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text7.txt + &mnf2 + c:\temp\text8.txt prn >nul

*    ??mesc+'*c' + mnfid2 + 'D'
*    ! COPY /B &mnf2 prn >nul
*    ?? mesc + '*c5F'

    * ' Check Number '
    set alte to c:\temp\text9.txt
    set alte on
    ??mesc+'*c' + mcfid + 'D'
    set alte off
    set alte to c:\temp\text10.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text9.txt + &mckf + c:\temp\text10.txt prn >nul
*    ??mesc + '*c' + mcfid + 'D'
*    ! COPY /B &mckf prn >nul
*    ?? mesc + '*c5F'

*\\ jjac 05/26/03
  IF mform = "ROFC"
    set alte to c:\temp\text11.txt
    set alte on
    ??mesc+'*c' + mafid + 'D'
    set alte off
    set alte to c:\temp\text12.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text11.txt + &maf1 + c:\temp\text12.txt prn >nul

*    ??mesc + '*c' + mafid + 'D'
*    ! COPY /B &maf1 prn >nul
*    ?? mesc + '*c5F'
  Endif
*\\
*\\ jjac 09/28/04
  IF  mform = 'IDODEP'
    set alte to c:\temp\text13.txt
    set alte on
    ??mesc+'*c' + mnfid1jj + 'D'
    set alte off
    set alte to c:\temp\text14.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text13.txt + &mnf1jj + c:\temp\text14.txt prn >nul
*    ??mesc+'*c' + mnfid1jj + 'D'
*    ! COPY /B &mnf1jj prn >nul
*    ?? mesc + '*c5F'
  Endif
*\\
    STORE TRIM(mmicrfont) TO mfstr
    set alte to c:\temp\text15.txt
    set alte on
    ??mesc+'*c' + mmid + 'D'
    set alte off
    set alte to c:\temp\text16.txt
    set alte on
    ?? mesc + '*c5F'
    set alte off
    set alte to

    ! COPY /B c:\temp\text15.txt + &mfstr + c:\temp\text16.txt prn >nul
*    ??mesc  + '*c' + mmid +'D'
*    !COPY /B &mfstr prn >nul
*    ?? mesc + '*c5f'
    * ' MICR Font'
    * ' Portrait or Landscape'
    * 'Evaluate for Landscape or Portrait Mode'
    STORE .F. TO mdl

else


This worked for the printer I was testing on which was a HP 5Si MX.  Today, the users came in and promptly rained on my celebration by printing to a different printer and having a problem occur.  The problem is that on the other printers, each of the copy commands causes a page to be ejected with a couple of left pointing arrows on it.  

I tried modifying the copy command to move the '/b' command to various positions (after reading up on xp copy command and the differences between where the /b is placed).  If I place it after the source, or after the dest, or both, I receive a buffer overflow on the printer.  Tried combining the commands into one big one, but exceeded the antiquated string length of 255 chars.  

The other printers are HP 5SI, and HP 8150N's.  I have been racking my brain trying to figure out why they would print differently than the others.
Finally realized the difference, and here is where I now need help:

The printer that is working is connected directly to the network through it's internal IO card.  The other three are connected through a JetDirect.  Go figure.  So now I am welcoming any suggestions why this is (the two 8150 printers have an IO card in them, but we are limited in our physical wired connections, so that is why they are sharing the jetdirect)

I look forward to any assistance.

To clarify the problem with the printers, they print out 6 blank pages and then print out the expected pages correctly.  But my users are not happy about the 6 pages with the two arrows on them.

And one more item, this is an ipx network , not ip.
I am assuming that when you say a "JetDirect" card you mean a external one?  IIRC all of the HP printers internal LAN card are JetDirects.

The six pages with the arrows on them are basically commands that the printer did not understand and the arrows are the printers attempt to print the "charcters".

Are there only 6 pages with the arrorws total?  When you left arrows do you mean <  or do you mean something like <- ?
From you statement, it would appear that the hp5si and hp5si mx don't use the same commands, since 5si mx understands it.

something like <- but the graphical version.

6 pages that match the six copy commands.
It appears that that is the "leftward arrow" which is a special encoding.  If codeing in a HTML plage you would put:

     &#8592

for decmial value or:

     &#x2190

for hex value.  Not sure if there is an easy way for you to check to see if you have that somewhere in the data unescaped.
Clarification  - they are both jetdirects

The internal (HP5SiMX) is a jetdirect J2552B and the external is a JetDirect EX Plus 3 J2593A

All setting seem similar.
ASKER CERTIFIED SOLUTION
Avatar of giltjr
giltjr
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The first part are hp escape codes.  the first one (which is actually the second one in the code) sets the font as permanent, the second (first) tells the printer what the font id is going to be.  the &mbf1 is a macro expansion that will put the actual font file name in the statement.  It is a binary file.  As far as the text files, if the escape code <esc> can be considerd as ascii, then it might work.  Remember this is a xp machine which handles the /b differently.  I will give it a try.  

The program originally redirects output to printer instead of the console and the ?? means echo to the output device without a cr/lf.  A ? by itself will put the information following the ? on a new line.

Since the program under xp did not seem to be putting the data out to the printer, I used the set alte to/on command to send the output to a disk file that I could copy.

I realize this was a lousy job of explaining, but it is late and I am tired, but cannot stop working since I will be heading back to the states on Saturday.

Thanks for your assistance.
you da man, er, woman, er person, uh, sentient being.

The last hurdle has been crossed.

I get to go home to see my children.

The world seems such a happier place suddenly.

In other words, thank you very much.  It is always the simple things that seem to be so hard.