View Full Version : Panasonic Printer

28-06-2005, 09:43 PM

I am using Panasonic Dot Matrix (KX-P1121). I am using this to Print tickets for Bus.
My Ticket Dimensions are:
Height: 3.5 Inch
Width: 9.55 Inch
I am using PreFormatted Paper to print tickets, with company logo & lables etc.

The Problem is: When i book 1 Ticket and gave print, its printing and its sending out paper, which is equivalent to size of A4 . So, i created new Custome Dimensions which exactly maches my Ticket Dimensions.. When i gave print, its taking only 3.5inch(height) paper in side and printing the text. After printing last line its stopping at that point. I need to role the Paper a bit, to tear the ticket.

How do exactly ask the printer to stop exactly at dotted line, (Tickets are attached with Dotted line). Lets say if two tickets are booked it should stop exactly after printing second ticket (at dotted line).

Any guys to help me.

Thanks in advance.

Terry Porritt
28-06-2005, 10:51 PM
You may well need to know the Panasonic 'escape codes' for your printer, these are the instructions that tell the printer what to do, like these here for Epson:

I really do forget now almost all about using escape codes, but most dot matrix printers are more or less compatible with epson.

Graham L
29-06-2005, 02:32 PM
What you need is the "Page Length" setting in the printer. That might be a switch setting (if you are lucky ;)). :( oops, hit the wrong button in this one. ...

Graham L
29-06-2005, 02:35 PM
What you need is the "Page Length" (or "Form Length") setting in the printer. That might be a switch setting (if you are lucky ;) ). Otherwise it might be a non-volatile setting ... check the manuals.

With that set correctly, it should work properly. Setting the pagelength only in software will always give problems.

Google might help ... try KX-P1121 "form length" as the search string.

29-06-2005, 07:19 PM

I set the Form Lenght in Server Properties of the Printer under Control Panel.
Which mataches exactly my Ticket Dimensions
Height: 3.5 Inch
Width: 9.55 Inch.

But, its stopping at the last line once printed,I need to role the Paper a bit to seperate the printed ticket.

Any Suggesstions.

Terry Porritt
30-06-2005, 12:06 PM
What is needed is the software to add one or more Line Feed characters and a Carriage Return. Easy to say, but I don't know how this could be done. Graham is sure to know. :)

It may be something as simple as finishing the ticket file when it has been written with a few extra [Enter] key strokes.

Graham L
30-06-2005, 01:45 PM
I'd be inclined to go for a FORMFEED (Ctrl/L, hex 0C) character. That will move the paper to the next form division.

The linefeed works as long as you calculate exactly, and don't make any changes. (The first person to follow you in maintaining this application will add a line. ;))

A formfeed is designed exactly for this function. It moves from the current position to the next form's start.

Early lineprinters had a sprocket driven loop of paper tape with holes punched in different columns at various intervals. According to the "channel" selected when a line was printed the paper would be moved by the distance bewteen the holes in that channel.

The first character in a line to be printed by a FORTRAN programme was the carriage control character and was not printed. "+" would cause no movement, for overprinting; " " would space one line (normal), "1" would double space, "0" would cause a form feed. (That last one must have wasted many pages of paper with one line printed per page. Most FORTRAN programmers made that mistake. At least once.)

30-06-2005, 04:08 PM
D-M printers are testing memories, here! What you are looking for is an instruction to tell the printer to issue a form feed at the end of the job. I remember vaguely that sometimes this was a dip switch setting but I have no idea whether this is so for this printer. Do you have the manual? If not, you could try ringing the NZ distributors, MEC, in Auckland. They will be able to tell you how to get that EOJ FF in.

30-06-2005, 07:50 PM

How to use the Form Feed. I tried to include "\f" in my code. but no effect.
Actually, i am generating PDF file with PHP Code. In that i specified "\f" at the end of the line.

Second option i made is in html before generationg PDF file i gave like this
<p STYLE="page-break-after: always">
<TABLE ...> .... </TABLE>

Any Suggesstions. I tried to grab information in the internet, but couln't find enough.


Terry Porritt
30-06-2005, 09:01 PM
I seem to recall in dos that a carriage return had to be added after a form feed, so perhaps try adding "\r" at the end of your php file.

Have to admit I'm groping in the dark :)

30-06-2005, 10:20 PM

Thanks for Reposne.. I am getting lot of info through this, which i am not aware till.

I tried with "\r" at the End of File. like this ..

echo "<TABLE ...> .... </TABLE>\r";

but still no use.
i have already gave my page dimensions, please look at it, if needed.


01-07-2005, 03:30 PM
Hi Friends,

Any Suggesstions on this issue?


Terry Porritt
01-07-2005, 04:04 PM
Have you tried a form feed and a carriage return at the end of the file?

I can't help with syntax, as I'm pretty useless with these things :)

Graham L
01-07-2005, 05:23 PM
The formfeed should move to the top of the next form. carriage return moves the printing point to the left margin. They are independent functions. The CR might be necessary so the next ticket won't lose part of its first line off the right hand margin, but that's irrelevant to the vertical form alignment.

Many "laser" printers required a formfeed to start processing a completed page. That's what the "showpage" command in PostScript sends. Sometimes it was necessary to tell a printer queue on a mainframe to sent an extra FF at the end of a job. Otherwise you lost the last page.

I am afraid that the problem is that the printing is being done through too many layers ... HTML, PHP, PDF ... A PDF file will then have to go through some more software to print it. :( :help:

Experiment with a few more ways of including a FF ... the C language "\" construct might not work in these other scripting languages. But I'm a bit dubious --- a PDF processing stage is probably going to strip off any FF it gets as input. It's meant to do the pretty formatting. ;)

01-07-2005, 06:17 PM
Tried to append at the end of the file with
\f\r (FormFeed & Carriage Return)

When i click View Source its showing like this.


And when i reverse the order at the end of line with \r\f, its showing like this in view source


and also unable to get the paper out as per requirments..

Any Sugg,


Graham L
02-07-2005, 02:45 PM
I'm not sure that HTML is understanding the "\f" as a formfeed character. It might be taking it as the two characters "\" and "f".

You could try the &012; method of including the FF in HTML, but again, I'm pretty sure that HTML formatting strips out any "whitespace" and does the formatting itself. :( (Whistespace is " ", TAB, FF, LF, CR, ...)

It seems pretty clear that your printer is never getting a formfeed. I think you're going to have to do it after all the scripting languages have had a go at it. If you were using Linux it would be trivial to drop a filter into the print service to add a FF. It might be possible to do a similar thing in Windows: write a programme which you send the printer file to (instead of direct to the printer) which just copies the file straight through, then appends a FF. I wrote one once in Pascal (inder DOS) to handle an odd printer, but that wrote to the printer hardware directly. That's not allowed in later OSs.

As a first step you could try making a file containing only a formfeed. (Notepad would probably do it if you can copy and paste the FF character from the ASCII character set table). Then send that to the printer immediately after your ticket file.

05-07-2005, 10:23 PM

Thanks for Help

Graham L:
I am able to print pages. But the thing left is getting the Ticket Out once printed. I think i am unable to use the "FormFeed" etc things.

Can instruct me, in previous msg u mentioned "making a file containing only formfeed". can u mention in steps, if possible, how to use etc..

Thanks in advance

Graham L
06-07-2005, 01:40 PM
One other printer thing you could look for and try: I noticed on the bottom of a (HP400) test page among the other settings was one called "Skip Perforation". Even though that's a sheet page printer that does exactly what you want ... when the printed area gets to the trigger point it ejects that page , ready for the next one. See if th Panasonic has a corresponding setting.

To make a Formfeed file depends on your editor programme. I don't know how things work in Windows XP. ;)

A DOS command sequence can do it : copy con: ff.dat, then enter Ctrl/L, then Ctrl/C. This probably won't work in XP. :(

Notepad: (Wordpad?:) use Alt followed by 0 1 2 entered with the keypad.
Then Save as a text file.

I think there is an ASCII table accessible in Windows which you can copy and paste characters from - even control characters such as the formfeed.

06-07-2005, 02:35 PM
"0" would cause a form feed. (That last one must have wasted many pages of paper with one line printed per page. Most FORTRAN programmers made that mistake. At least once.)

Yes GrahamL some of us made the mistake deliberately - as a student I used the old computer paper to study on (writing out everything ......) and of course you made sure you had enough "scrap" paper

And using Fortran and PL/1 - golly, they still use it these day?


Graham L
07-07-2005, 12:50 PM
First, an oops:

A DOS command sequence can do it : copy con: ff.dat then enter Ctrl/L, then Ctrl/C. This probably won't work in XP. :(
Of course you need Ctrl/Z not Ctrl/C to indicate end of file ..., and an Enter to tell the command interpreter that the line has ended...
That works in Windows 2000 Pro, and produces the one character file.

I've had a bit of a play with the Windows Printers page. We might, at last, have the answer. ;) I installed a Panasonic 1123 (W2k doesn't seem to have the 1121) driver to test this but the other printers I have installed seem to have this.

Right click on the appropriate printer's icon. Select its Properties page. Choose the "Advanced" tab. At the bottom, in the middle, there is a button : "Print Processor".

I suspect RAW (FF append) rather than RAW in the right hand column might be just what is needed. (That will "append" (add at the end) a formfeed character.) If that doesn't work, try RAW (FF auto).

07-07-2005, 05:17 PM

Graham L: First many thanks for your support & sorry for troubling u.

I tried with changing properties,RAW (FF append),RAW (FF auto). But no change.

Do i need to include anything in my PHP File?

i am unable to get 1123 drivers and tried with 1131. actually my printer is 1121.

I am using Win XP & Win ME for testing.


Graham L
07-07-2005, 05:41 PM
I wasn't intending that you load the 1123 driver ... whatever driver the printer is working with should have the same setting possibilities. ;)

Can you print two or more tickets and have the first one(s) come out correctly?

Have you tried creating a "FF" file (using Ctrl/Z as in my correction) ? The WinME version of "DOS" will certainly make the file. Then copy FF.dat LPT1: would send it to the printer (If your printer is on LPT1, of course). If the first ticket (or tickets) come(s) out correctly, with only one "hanging" , and sending the formfeed file makes it eject we're there.

Back in the printer Properties pages ... one of the pages lets you chose spooling or not. Have you tried the option "Print directly to printer" (something like that) ? [This is desperation ... this is one of those silly things which should be so simple. :( ]

07-07-2005, 11:20 PM

Graham L: Many Thanks for support,

I tried FF.dat option. i did like this. in command window

^L^Z and then Enter. Its saying 1 file(s) copied, but when i copy using

C:\> copy FF.dat LPT1: (my printer exists on LPT1)
its saying "The system cannot find the file specified."

I tried with Option "Print directly to printer" also. But no use.

Yah. exactly, i know that its very simple. becoz my lack of knowledge with printing.. i having trouble & giving other trouble.. Sorry for that.

When i print 2 or more ticket, first one is ok.

I decided to test the code with other printers. i am not sure, hope something helps or even i will get some idea with that.


Graham L
08-07-2005, 02:30 PM
You need another space in that copy command ;). The copy is from the device CON: ("console" which is the Teletype -- keyboard and monitor these days) to a file called FF.dat .

I don 't know what got copied, but it most likely wasn't a formfeed, and not to the file we wanted to create.

(also check where the file is created ... and try a dir *.dat to see that the file has been made, and is 1 byte long.)

It looks good if you get the first one of two out correctly. ;) The FF.dat file might be all you need. A little batch file and an icon ... ;) If only life was always easy. Computers were invented to keep us humble.

Graham L
09-07-2005, 03:02 PM
I tried the command without the space this morning. As I should have realised yesterday, it copied a file, with the name FF.dat but the name is ignored, because CON: is not a file structured device from CON: (keyboard) to "nowhere", which probably defaults to the source, CON: . No new file is created anywhere. It's all very logical. CP/M is good. :cool: :thumbs:

Billy T
09-07-2005, 04:26 PM
I know that you are looking for a technical solution, but sometimes it is easier to simply add a blank ASCII character at the start of the next one or two lines just to make the printer feel good about advancing the form a little further.

If blanks don't work, use asterisks, pipe symbols or just full stops, the clients won't examine their tickets that closely.

The first rule of economic computing is: "beware of creeping elegance." :waughh:


Billy 8-{) :2cents:

Graham L
09-07-2005, 04:55 PM
I'm trying to get a crude fix ... but not that crude.

The trouble with Billy's blunt instrument is that it can lead to a 50% waste of forms.

It appears to work properly with "n-1" forms (when n = 2, at least, so it's on the right track ... it's just getting the nth form to eject which is the problem.

I've been through this sort of thing a few times, and it does have to be right.

25-07-2005, 05:57 PM

We have decided to Use EPSON LQ-680 Pro Printer for this Ticket Printing. Becoz others using the same.. We have not yet tried printing with this Model..
(for clarity see the intial post in this Thread)

I got doubt that, is this printer also give problems like Panasonic..?? or works fine.. i.e scrolling out the ticket once printed? anybody got idea?

Anyway thanks for the support for my previous questions.. Thanks all


Graham L
26-07-2005, 01:05 PM
A nasty thought occurred to me as I looked at the control panel of a similar Panasonic printer at the bottom of a heap of equipment. ;)

Since the printer is handy to the operator, why not just press the FF button when there's a single form to eject? (I have a suspicion that that's why Panasonic put it there. :cool:) It's all very well to do everything in software (and I'm pretty sure my FF file would have worked if you had put a space in that command line) but sometimes the hardware way is quicker.