Get printer to cut after each job in sco unix

Using sco openserver 5.0.5 for a dry cleaning point of sale system.  When staff enter the items the printer will print tags for each one so they can be attached to the item.  The tag printer is a Samsung impact emulating Epson. Works great except it would be nice if it would  cut after each tag is printed.

The printer is set up as lp and model epson.  Is there a command I can insert into the lp script to tell the printer to cut after each tag is printed.  I have attached the lp file.  I hope this is the right one that is being used for the printer.
Also is there some way I can get the printer to print in bold.

Printer is attached to serial port 1 /dev/tty1a
LP
sco505Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

arnoldCommented:
See whether you set the length of output to match the length of tag, and then make sure you activate the cutter.

Here is an example reference, see if you send these controls whether the cutter activates at "end of page"

http://lprng.sourceforge.net/DISTRIB/RESOURCES/PPD/epson.htm
sco505Author Commented:
Thanks for that, but I have no idea where I would insert these in the lp file.

You're talking to a dummy as far as this is concerned.
sco505Author Commented:
I should have mentioned that the printer prints on 76mm x 76mm paper rolls
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

arnoldCommented:
These are control characters that set the printer to indicate the length of the paper, enable cutter at end of page, before you send the data

I.e.
First thing your lp filter/script should send the control characters setting the page size, activating.
76mm, meaning it has 8-10 lines
Don't the tags have perforations for easy tearing.
arnoldCommented:
In the example echo "\033\" etc are commands to the printer that are not output.

You have to identify the control that triggers the cut solenoid.

Look at the specs of your printer, while it can emulate, at times, it has its own......

I.e you would at the end of the tag send the EOF\EOR triggering the cutter.
sco505Author Commented:
Each tag could be different from others, eg 1 could have this printed

1 Trousers
Blue
Monday
-------------------------Invoice #------

the next
 
Dress Shirt
White
Press Only
Monday
-------------------------Invoice #------

It would be nice if they were cut after each one.  Saves using scissors
arnoldCommented:
That is part of the filter that processes the data I.e. At the conclusion of the data it issues the correct echo "\cut\ you have to identify the control sequence to do that.

Alternatively, your script will have to first check how many lines, set the length, and then output the data.

I.e. Job has 10 lines, once ten lines are output with the printer set to cut at end of page, once the 10 lines are output, the cutter will be kicked in.
The next set for a five line printout, will do the same thing after the last line is output.

The lp setup, filters allow the sending process to set page lengths as well.....

...
mikelfritzCommented:
What exact model of Samsung printer?  The answers above are correct, but it looks like you need a little more help.

In SCO or any Sys V system, the printer driver is nothing but a filter...

Raw data -> Filter (oven) -> Print data (cooked data)

The added codes the filter puts in allow for things like this, the exact code to activate the cutter is what is needed, along with the form length possibly.  The default Epson SCO driver "filter" has no cutter available; It's relatively easy to add the escape sequence to tell the printer to cut, then it's a matter of telling it when to cut...
mikelfritzCommented:
It could be as simple as adding the cut command to the from feed depending on the data stream.
arnoldCommented:
The decimal/ASCII FX example \033 is the octal representation of ESC or the decimal rep of 27

Activate cutter At end of page in the filter setting parameters.
echo "\033\0314\c" #cutter on end of page
echo "\0332\c" #set six lines per inch
echo "\033C02\c" #set page length 2 inches

File to be printed
1
.
.
.
13
And see whether between line 12 and 13 the paper is cut.

Man lpr I think it too has an option to set page settings.
arnoldCommented:
Here is the ASCII table you can use to convert the FX code examples into the control commands.

http://www.asciitable.com

The directives \033 Uses octal data, for non render able characters/controls such as escape, control, etc.
Characters can be entered as A or as \101
Esc A
\033A\c or \033\101\c
sco505Author Commented:
I assume that the lp file I attached to my original query is the 1 that is used.  I copied it form /usr/spool/lp/admins/lp/interfaces.  
I tried inserting echo "\033\0314\c" in a couple of places without any luck. (bottom of file in red)

Am I putting them in the wrong place?  I have no idea
LP.doc
arnoldCommented:
Yes, you are placing one line out of three that you need.

See whee you have z001 reset printer to default.
The three lines need to be right after that.
I believe each line is described as to what I think it sets and what its implications are.

After printer is reset to default, the next line sets/enables the cut mechanism at the end if the page. The next commands sets the line sizing of 6 lines per inch. The next command sets the size of the paper I the example it is 2 inches.
Once that is set, between the 12th and 13th output lines, if everything goes as planned, the printer cutter should activate.
arnoldCommented:
If you have a windows system near by that has a comm port to which you can connect this printer.
Set it up as an ASCII Epsom emulated similar to what you think it is. Set page size and print a test and you should see the cutter activate.  Look at the printer properties/settings it should have an option dealing with the cut, it should show there the control sequence that it issues to trigger the cut. ^B or something like that, translating it into the \033X\c
Will help as you an add it at the end after the data stream instead of \f\c

Not sure whether \f\c is supposed to be a form feed to end of page so it can be torn at the perforation.

If true, once cutting is properly enabled, and page length set, the printer should position the paper in the correct .......... And cut
arnoldCommented:
One more thing, you have not yet identified the Samsung printer that you have model.
sco505Author Commented:
It's a Samsung Biloxon SRP-275CG
sco505Author Commented:
Sorry I use a Mac.  
I've inserted the 3 lines as suggested just below the Z001 line.
Still no luck.  Printed a ptest file but it didn't cut at all
arnoldCommented:
The system you are using is unimportant.

I am missing something, your question deals with sco Unix is this a VM/or a separate system?
Can you connect the printer to your Mac and print? It too should activate the cutter at the end of the page.

What is the model of the Samsung impact printer?

There are many impact printers being sold with emulating Epson.
Some include their own options but should follow the Epson ESP/P, the difficulty is that one has to identify which Epson commands it might vary/include some direct option that will activate the cutter.I.e.
sco505Author Commented:
It's a Samsung Biloxon SRP-275CG

It is a separate system.
arnoldCommented:
Try adding the following sequence  echo "\033@\035V\c" after the Echo "\f\c"
mikelfritzCommented:
Any way to get the actual data stream?  Maybe set up another printer with device /tmp/label.tst and print to that.

The filter itself is only going to add the command to the end of the job, unless each label is printed as a separate job adding a cut here won't do what you want.

The manual looks to have a command to set for cut on form feed - if the data stream has form feeds then maybe we can set it as a parameter up around the banner line option.  If not then SED or AWK could insert it in the stream.
arnoldCommented:
agree with the form feed which I think \f\c does, but one is required to activate that mode of operation, set the page length, number of lines per ......

The sequence is missing a 1 after the V
Echo "\033@\035V1\c"

Try this Echo "\033@\035V1" | lpr -Pprintername

This should bypass the filer.
arnoldCommented:
Form feed is Echo "\014\c"
sco505Author Commented:
Tried adding echo "\033@\035V\c"  after the first  echo "\f\c" .  Nothing

Added it after the last echo "\f\c" and nothing, but when I pressed the Paper Feed button it cut.
Getting there.  

If it could do a 3 line feed at the very end of the job regardless of how many labels were printed and then when the Paper Feed button was pressed it would cut I'm sure that would satisfy the user
arnoldCommented:
Try \014\c
Should trigger a form feed based on the page length in the printer.
I am not sure what \f\c is supposed to do..
mikelfritzCommented:
The \f\c is equivalent to  \014\c in SCO print filters.
arnoldCommented:
Three line feed? if you do nothing and hit feed form on the printer how long I the paper before it is cut.  That will tell you what the page length is set to.
See if you can change the page length with the suggestions from before and see if the printer form feed matches that.
sco505Author Commented:
It would cut immediately.  After adding the 1 after the 035 it now cuts at the end.
Just 3 line feed now.  Tried adding \014\c line 3 times but nothing
arnoldCommented:
Cuts at the end of what?

You need to use the z0001 which first resets the printer to default.

Then you can look at z002 and possibly add a check for allowing you to specify the page length of each label.

Your initial question suggests that you want to minimize paper waste I.e. A 6 line label should be cut after the sixth line, a 9 line label should be cut after the 9th, this precludes the
Comment out the prior page size setting, the lines per inch controls for the font size.
The \033@ resets the printer to defaults
If you add a echo "\035V1\c", does it cut?
Or did you mean Echo "\0351\c" triggers the cut?
sco505Author Commented:
It's working in as much as it cuts after each label except the last one.  So have to feed paper and rip off.
arnoldCommented:
Please post an example of what you are printing and the updated filter.
And the commands you use to set the document to the printer.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sco505Author Commented:
We've changed the system.  Swapped printers around.  To be fair I should close this question and start another which I will do shortly.  Still having problems but slightly different.  Thanks again
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.