Help with Win->Unix printing - SMB

This is a discussion on Help with Win->Unix printing - SMB ; Am running Samba V2.2.7a on a SCO 5.0.2 system. The printer 'spmgm3' is a valid unix printer attached to a wyse terminal at /dev/prn1c06. Have added the following to smb.conf to make 'spmgm3' available to windows users. [spmgm3] printing = ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: Help with Win->Unix printing

  1. Help with Win->Unix printing

    Am running Samba V2.2.7a on a SCO 5.0.2 system.
    The printer 'spmgm3' is a valid unix printer attached to a wyse terminal at
    /dev/prn1c06.

    Have added the following to smb.conf to make 'spmgm3' available to windows
    users.

    [spmgm3]
    printing = sysv
    comment = Johns Test Printer
    browseable = yes
    printable = yes
    printer name = spmgm3
    public = yes
    writable = yes
    create mode = 0755
    path = /tmp
    print command = lp -o nobanner -s -c -d %p %s > /dev/null 2>&1 ; rm %s
    printer driver = Epson LX-300+

    The printer 'spmgm3' then appears in the network neighborhood, and I am able
    to create this printer on a windows box. When I print to it, a file
    '/tmp/smbprn.000004.a0079f' is created and I assume sent to the Epson
    printer 'spmgm3'.

    Problem is that the printer prints about 2 characters and locks up,
    requiring a restart. Looking at the file above is no help as it is not
    readable. It appears to be a compiled file created by the print process from
    windows.

    Can anyone help me with this one??

    Thanks and regards,

    John Clarke



  2. Re: Help with Win->Unix printing

    "John Clarke" wrote in
    news:3ef7c7d6$1@duster.adelaide.on.net:

    > Am running Samba V2.2.7a on a SCO 5.0.2 system.
    > The printer 'spmgm3' is a valid unix printer attached to a wyse
    > terminal at /dev/prn1c06.
    >
    > Have added the following to smb.conf to make 'spmgm3' available to
    > windows users.
    >
    > [spmgm3]
    > printing = sysv
    > comment = Johns Test Printer
    > browseable = yes
    > printable = yes
    > printer name = spmgm3
    > public = yes
    > writable = yes
    > create mode = 0755
    > path = /tmp
    > print command = lp -o nobanner -s -c -d %p %s > /dev/null 2>&1 ; rm
    > %s printer driver = Epson LX-300+
    >
    > The printer 'spmgm3' then appears in the network neighborhood, and I
    > am able to create this printer on a windows box. When I print to it, a
    > file '/tmp/smbprn.000004.a0079f' is created and I assume sent to the
    > Epson printer 'spmgm3'.
    >
    > Problem is that the printer prints about 2 characters and locks up,
    > requiring a restart. Looking at the file above is no help as it is not
    > readable. It appears to be a compiled file created by the print
    > process from windows.
    >
    > Can anyone help me with this one??
    >
    > Thanks and regards,
    >
    > John Clarke
    >
    >
    >


    Hi John,

    in the Windows system control go to the printers properties,
    in the extended settings set
    "start printing after spooling last page". This prevents
    a connection timeout which might happen if the first part of
    the print job is submitted and the next page - i.e. a
    complicated graphics - needs a longer time to be printed.

    Another possible problem source is automatic print job
    translation by the print system itself. Some print systems
    (i.e. LPRng i use) classify incoming print jobs to be
    raw print data, postscript, dvi, groff output or plain text...
    and run filters to enforce postscript output.
    When printing from Windows systems your jobs file type
    is binary or raw print data. When running LPRng lpr command
    I can specify "-l" or "-b". Unfortunately I do not know sysv
    printing options for this, please check the man page.

    Yet another problem might be the "lpr ... ; rm ...".
    On some systems the lpr command returns immediately
    while doing the printing in a background process. In this
    case the rm removes the print data file while printing
    is running. LPRng's lpr command has a "-r" option
    to remove the printed file after finishing printing.
    This allows to run "lpr -r ..." instead of
    "lpr ... ; rm ...".
    Check your lp for one of the following options:
    - remove printed file after printing or
    - make lpr return after spooling the file is completed or
    - use a temporary copy of files for printing.

    Hope this helps.
    Regards,

    Dirk

    --
    Dirk Krause
    http://et.fh-schmalkalden.de/personen/dhp/krause

  3. Re: Help with Win->Unix printing

    Dirk,

    Thanks for your thoughts, no luck though.

    Tried setting the printer in windows to print after last page spooled and
    print directly to printer but no change.
    Have removed the 'rm' command from the print command also so that I can
    check on the file being printed.

    I cant find any options other than postscript and raw for the SCO lp
    command.

    Whatever options I try, my printer simply prints a few characters jammed
    together. eg '@EJL', and then locks up and must be restarted to work.

    As the file created on my unix box each time I send a print request from
    windows it appears to be binary, this is not my area so I am assuming here,
    this is probably be what is causing the problem. Also I have naturally
    tested that a plain text file created in unix prints fine.

    Thanks agin for your thoughts, perhaps someone else will pick up on this.

    Kind regards,

    John



    "Dirk Krause" wrote in message
    news:Xns93A46E3CB3E25dkrausefhsmde@141.54.1.3...
    > "John Clarke" wrote in
    > news:3ef7c7d6$1@duster.adelaide.on.net:
    >
    > > Am running Samba V2.2.7a on a SCO 5.0.2 system.
    > > The printer 'spmgm3' is a valid unix printer attached to a wyse
    > > terminal at /dev/prn1c06.
    > >
    > > Have added the following to smb.conf to make 'spmgm3' available to
    > > windows users.
    > >
    > > [spmgm3]
    > > printing = sysv
    > > comment = Johns Test Printer
    > > browseable = yes
    > > printable = yes
    > > printer name = spmgm3
    > > public = yes
    > > writable = yes
    > > create mode = 0755
    > > path = /tmp
    > > print command = lp -o nobanner -s -c -d %p %s > /dev/null 2>&1 ; rm
    > > %s printer driver = Epson LX-300+
    > >
    > > The printer 'spmgm3' then appears in the network neighborhood, and I
    > > am able to create this printer on a windows box. When I print to it, a
    > > file '/tmp/smbprn.000004.a0079f' is created and I assume sent to the
    > > Epson printer 'spmgm3'.
    > >
    > > Problem is that the printer prints about 2 characters and locks up,
    > > requiring a restart. Looking at the file above is no help as it is not
    > > readable. It appears to be a compiled file created by the print
    > > process from windows.
    > >
    > > Can anyone help me with this one??
    > >
    > > Thanks and regards,
    > >
    > > John Clarke
    > >
    > >
    > >

    >
    > Hi John,
    >
    > in the Windows system control go to the printers properties,
    > in the extended settings set
    > "start printing after spooling last page". This prevents
    > a connection timeout which might happen if the first part of
    > the print job is submitted and the next page - i.e. a
    > complicated graphics - needs a longer time to be printed.
    >
    > Another possible problem source is automatic print job
    > translation by the print system itself. Some print systems
    > (i.e. LPRng i use) classify incoming print jobs to be
    > raw print data, postscript, dvi, groff output or plain text...
    > and run filters to enforce postscript output.
    > When printing from Windows systems your jobs file type
    > is binary or raw print data. When running LPRng lpr command
    > I can specify "-l" or "-b". Unfortunately I do not know sysv
    > printing options for this, please check the man page.
    >
    > Yet another problem might be the "lpr ... ; rm ...".
    > On some systems the lpr command returns immediately
    > while doing the printing in a background process. In this
    > case the rm removes the print data file while printing
    > is running. LPRng's lpr command has a "-r" option
    > to remove the printed file after finishing printing.
    > This allows to run "lpr -r ..." instead of
    > "lpr ... ; rm ...".
    > Check your lp for one of the following options:
    > - remove printed file after printing or
    > - make lpr return after spooling the file is completed or
    > - use a temporary copy of files for printing.
    >
    > Hope this helps.
    > Regards,
    >
    > Dirk
    >
    > --
    > Dirk Krause
    > http://et.fh-schmalkalden.de/personen/dhp/krause




  4. Re: Help with Win->Unix printing

    "John Clarke" wrote in
    news:3ef8f7b9@duster.adelaide.on.net:

    > Whatever options I try, my printer simply prints a few characters
    > jammed together. eg '@EJL', and then locks up and must be restarted to
    > work.


    Hi John,

    The string '@EJL' introduces a print job control sequence in PJL
    (HP's print job language) and other printer control languages.
    Normally such strings should not be printed, they are used to
    set up printer resolution, duplex printing...
    If this string appears on paper it is very likely some
    filtering is going on in your print system converting
    these control strings to printable output.
    So you should try the "raw" option of your lp program.
    If filtering is working the problem is to find out whether
    filtering takes place in your Samba server's print system
    or in the Wyse terminal's print system.

    To check whether the printer driver and it's settings are
    ok connect the printer locally to the Windows computer and print
    a test page.

    Another test is to print a test print job (i.e. from notepad or so)
    to file on the Windows computer and to print the same thing to
    the Samba printer share. If you have no "rm" running you can
    compare the /tmp/smbprn.000004.a0079f file and the file created
    on the Windows computer, they should have the same contents.

    You can also transfer the Windows print job file to
    the Samba server and play with lpr/lp options allowing to print
    the file correctly. On success use the same options in smb.conf.

    Try to place "printing=sysv" in the global configuration section.

    Regards,

    Dirk

    --
    Dirk Krause
    http://et.fh-schmalkalden.de/personen/dhp/krause

  5. Re: Help with Win->Unix printing

    Hi Dirk,

    Thanks for the suggestions.
    The printer works fine if I send a print job directly to it when connected
    to a Win box.

    Have tried to print 'This is a test' from wordpad to a file on my windows
    box and to the shared samba printer on unix.
    Both files were identical as under;

    @EJL 1284.4
    @EJL
    @
    t6R P(U
    (C (c H r
    r $5 *p              
              
    J$5 *p         
         
       
    J$7 *l @` @` `
    ??? @` ???
    J$6 *m `? @ `? @ @
    @ `? @ @ @

    Is this what you would expect?

    Have tried all combinations of printing this file in unix with lp but
    printer just locks up after the @EJL each time.
    Something that seems so simple should not be so difficult I am sure.

    Lp must be changing this file somehow to make it unnacceptable to the
    printer as printing it from windows to a windows Epson LX300 printer is
    fine. (From wordpad that is and not from the file created.)

    Have had a few other opportunities today so didnt have much time for this
    but will try again tomorrow.

    Thanks again for your help.

    John



    "Dirk Krause" wrote in message
    news:Xns93A56E5C653Ddkrausefhsmde@141.54.1.3...
    > "John Clarke" wrote in
    > news:3ef8f7b9@duster.adelaide.on.net:
    >
    > > Whatever options I try, my printer simply prints a few characters
    > > jammed together. eg '@EJL', and then locks up and must be restarted to
    > > work.

    >
    > Hi John,
    >
    > The string '@EJL' introduces a print job control sequence in PJL
    > (HP's print job language) and other printer control languages.
    > Normally such strings should not be printed, they are used to
    > set up printer resolution, duplex printing...
    > If this string appears on paper it is very likely some
    > filtering is going on in your print system converting
    > these control strings to printable output.
    > So you should try the "raw" option of your lp program.
    > If filtering is working the problem is to find out whether
    > filtering takes place in your Samba server's print system
    > or in the Wyse terminal's print system.
    >
    > To check whether the printer driver and it's settings are
    > ok connect the printer locally to the Windows computer and print
    > a test page.
    >
    > Another test is to print a test print job (i.e. from notepad or so)
    > to file on the Windows computer and to print the same thing to
    > the Samba printer share. If you have no "rm" running you can
    > compare the /tmp/smbprn.000004.a0079f file and the file created
    > on the Windows computer, they should have the same contents.
    >
    > You can also transfer the Windows print job file to
    > the Samba server and play with lpr/lp options allowing to print
    > the file correctly. On success use the same options in smb.conf.
    >
    > Try to place "printing=sysv" in the global configuration section.
    >
    > Regards,
    >
    > Dirk
    >
    > --
    > Dirk Krause
    > http://et.fh-schmalkalden.de/personen/dhp/krause




  6. Re: Help with Win->Unix printing

    "John Clarke" wrote in news:3efaa97a$1
    @duster.adelaide.on.net:

    >
    > Hi Dirk,
    >
    > Thanks for the suggestions.
    >


    Hi John,
    on my old Solaris 2.6 the lp man page says, I have to
    use the "-r" option for raw printing.
    So you can try

    lp -r ...

    Another test:
    Transfer the file to the Wyse terminal, log in as root
    there and type

    cat file > /dev/... (insert printer device here)

    If this prints the file correctly, go to the Samba server
    and try

    lp -d printqueue@wyseterminal -r

    use your print queue name and the host name or IP address
    of the Wyse terminal. Possibly you have to replace
    -d by -P, consult the man page.

    I have a long weekend now, will be back on monday.
    Can you send a copy of your lp's man page?

    On Solaris 2.6 there is a directory
    /etc/lp/fd containing files *.fd.
    These files contain print filter descriptions, each file
    has a line like "Input types: simple,postscript" and a
    line "Command: /usr/bin/cat". Input types and commands differ.
    Check for one *.fd file pointing to the "cat" command
    or which has no command specified. Take a look at the input
    type and try
    lp -T simple -r ...
    This marks the print job as type "simple". While looking at
    the *.fd files the print system finds the appropriate filter
    information and selects the cat command as filter which
    does not apply any change to the print job before transferring
    it to the printer.

    Regards and have a nice weekend

    Dirk

    --
    Dirk Krause
    http://et.fh-schmalkalden.de/personen/dhp/krause

  7. Re: Help with Win->Unix printing

    Dirk,

    Tried lp -oraw samba_print_file and only got the @EJL. This is the raw
    option as per the man pages

    Tried 'cat samba_print_file >/dev/prnxxxx' where /dev/prnxxxx is the printer
    attached to the Wyse terminal.
    A small improvement in that it printed the 1284.4 that came after the @EJL.

    My Wyse terminal does not have an ip address nor a print queue nor any
    ability to store a file for printing. It's just a dumb serial terminal. It
    uses pass through or attached printing. All print jobs are prefixed and
    appended with a control code by my Stallion serial port software. These
    control codes switch the display off/printer on and back again at the end of
    the print job.

    Also have the -T option with SCO's lp.
    Tried lp -T simple -r etc, but same result.

    I guess my thoughts at this time are that if I cannot cat the file
    successfully to the printer which would send it 'as is' then there must be a
    problem with the contents of the file itself.

    If you send a print job to a samba printer share from wordpad on your win pc
    that says 'This is a test', does the file created on your unix box look the
    same as mine from my prev. post?

    Will attach the lp man file to a separate mesg and send it direct thogh I'm
    not sure that you will find much.
    I've been thru it a dozen times already.

    You must be having a long weekend with Friday off if you are off for the
    weekend already.
    Good luck to you. I have 8 hours to go before mine.

    Have a good one and thanks again.


    Regards,

    John


    "Dirk Krause" wrote in message
    news:Xns93A6BF833FD39dkrausefhsmde@141.54.1.3...
    > "John Clarke" wrote in news:3efaa97a$1
    > @duster.adelaide.on.net:
    >
    >
    > Hi John,
    > on my old Solaris 2.6 the lp man page says, I have to
    > use the "-r" option for raw printing.
    > So you can try
    >
    > lp -r ...
    >
    > Another test:
    > Transfer the file to the Wyse terminal, log in as root
    > there and type
    >
    > cat file > /dev/... (insert printer device here)
    >
    > If this prints the file correctly, go to the Samba server
    > and try
    >
    > lp -d printqueue@wyseterminal -r
    >
    > use your print queue name and the host name or IP address
    > of the Wyse terminal. Possibly you have to replace
    > -d by -P, consult the man page.
    >
    > I have a long weekend now, will be back on monday.
    > Can you send a copy of your lp's man page?
    >
    > On Solaris 2.6 there is a directory
    > /etc/lp/fd containing files *.fd.
    > These files contain print filter descriptions, each file
    > has a line like "Input types: simple,postscript" and a
    > line "Command: /usr/bin/cat". Input types and commands differ.
    > Check for one *.fd file pointing to the "cat" command
    > or which has no command specified. Take a look at the input
    > type and try
    > lp -T simple -r ...
    > This marks the print job as type "simple". While looking at
    > the *.fd files the print system finds the appropriate filter
    > information and selects the cat command as filter which
    > does not apply any change to the print job before transferring
    > it to the printer.
    >
    > Regards and have a nice weekend
    >
    > Dirk
    >
    > --
    > Dirk Krause
    > http://et.fh-schmalkalden.de/personen/dhp/krause




  8. Re: Help with Win->Unix printing

    "Dirk Krause" wrote in message
    news:Xns93AA724D67F8Cdkrausefhsmde@141.54.1.3...
    > "John Clarke" wrote in
    > news:3efb9123$1@duster.adelaide.on.net:


    > Hi John,
    > you can verify the correctness of the print file by attaching
    > the printer to the Windows computer and typing
    > copy file lpt1: /B
    > May be the problem is in the control codes switching the
    > Wyse terminal between display and printer use.
    > A binary print job file may contain seqences of binary numbers
    > which your Wyse terminal may interprete somehow.
    > I'd suggest to connect the printer to either the Windows PC or to
    > the UNIX server running Samba.
    > If the printer is a PostScript printer you can try to install a
    > PostScript driver for that printer on the Windows PC. But you must
    > make sure the print jobs generated by the driver do not contain
    > leading and trailing binary job control data. Maybe you need to
    > edit the *.ppd file for the printer. Alternatively you can use
    > the Adobe standard Postscript driver.


    Dirk,

    You hit the nail on the head. I don't know why I didn't think to test this.

    It DOES NOT work with ATTACHED printers.

    I set up a dedicated serial printer and BINGO, worked perfectly first time.

    As I said before, something so simple should not be hard to set up and it
    wasn't in the end.
    I will have to change a few printers over from attached to dedicated but
    that then fixes the problem.

    Thanks for your help and if you are ever in Adelaide, South Australia, I owe
    you a few beers.

    Kind regards,

    John Clarke



+ Reply to Thread