Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing help in FPD for DOS

Status
Not open for further replies.

MBSCSI

Programmer
Dec 22, 2003
19
US
I need to upgrade a report in FoxPro 2.6 for DOS. The system needs to fill out a pre-printed form. The problem is the form does not line up correctly. When I finish the heading information and get to the body of the form, it starts at line
24.5 so the data prints in the lines instead of in the boxes. What I want to do is change the line spacing at the end of the header routine from 6 lines per inch to 12 lines per inch.

Then LC=LC+1 will move the cursor 0.5" down instead of 1" down and the I can change it right back.

Can someone please guide me through this.

Thanks,

Michael Serdikoff

p.s. I can't wait to finish porting this to Windows so I don't have to deal with this, but that is another story.
 
It ahs been a LONG, LONG time since I last worked with Reports in FPD, but the last time that I did I had to embed some printer control command into the FP Report Form.

I first looked into my Printer's Programmers Manual (look on the web) and identified which Print Command Language (PCL) command(s) were necessary to make the printer do what I needed it to do.

I then tested these command by sending them to the printer directly via the Command Window and confirmed that they indeed did what I needed.

Once that was complete I went to my Procedure File and created a few small User Defined Functions (UDF) which sent the commands to the printer in the same manner that I did in the Command Window. And another UDF to reset the printer settings to the Default settings.

Finally I went to the FP Report Form and created a Text Box (1 Char wide) where I first wanted the command to be issued. In that Text Box's Expression I called the new UDF(s). When I wanted the command reversed (reverting to the printers Default settings) I did the same thing, but called the UDF which issued the Reset command.

Good Luck,
 
Thanks for the quick response, but this is not in a report file. This is a hard coded program that prints insurance forms for a dentists office.

I use LC as the line counter variable and then I print at LC,21 for example. This is a hard coded prg file. I need to send the commands to the printer via the ??? command. I just don't know how to set the line spacing to 12 lines per inch instead of 6 lines per inch.
 
This is a hard coded program that prints insurance forms for a dentists office.

You still need the printer manual to discover the printer control codes for line-spacing. Fox can send the codes to the printer with ??? but Fox doesn't know the codes for your particular printer.

Geoff Franklin
 
"this is not in a report file"

All the easier.

Do the above suggested investigation and determine what your specific printer's PCL command(s) need to be sent to the printer to get it to do what you want.

Then you only need to add a new line of code where you need it to work. That new line of code would be the same as you used via your Command Window during the testing.

Example:
Code:
* --- HP4 Code ---
cCPI12 = CHR(27)+"&k4S"
cBOLD10 = CHR(27)+"(s0p10h0s3b4102T" && ltr gothic bold
cULON =CHR(27)+"&d4D"   &&&enable UL
cULOFF = CHR(27)+CHR(38)+CHR(100)+CHR(64)

* --- Issue Desired Command ---
??? cULON  && Turn on Underline
   <Do Whatever>
??? cULOFF  && Turn off Underline

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 

27 65 n ESC A n Select n/72 inch line spacing (n=0..85)


This code if for Epson. High chances that it will work for your printer.

t_SetLpi72 = chr(27) + 'A1' && Hopefully sets to 72 LPI
t_SetLpi36 = chr(27) + 'A2' && Hopefully sets to 36 LPI
* And so forth

??? t_SetLpi36

try it

Nasib
 
I think I'm getting warmer. The standard page is 66 lines per inch and I want to shrink it to 33 and then send it back. I just don't understand the Select n/72 inch line spacing (n=0..85) command?????
 
Rather than working with our "best guesses" for which Printer Command Language commands you need, have you done as suggested and searched the web for your specific printer's commands - the ENTIRE set?
Or have you gone to your printer manufacturer's website and downloaded their Programmer's Manual (or other such document)?
Or contacted their Customer Support to get the commands?

BUT rather than telling us what you have and hoping that we can just tell you what to use, it would be MUCH better if you investigated the matter and discovered the answer for yourself.

Remember that our primary role here is to help you towards finding your answers, not necessarily just do it for you.

Besides, you haven't even told us what specific printer (mfg & model) you are using.

As to Nasib's posting for a 'generic' Epson printer
Code:
* -- 27 65 n  ESC A n  Select n/72 inch line spacing (n=0..85) ---
* --- Equates to... ---
cLPI = chr(27) + 'A' + <a character representation of a number>  && Such as "9" for 9/72 or 0.125" line spacing

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Watch out if you are running XP it will "crash" if you try and send a ??? to the printer. XP cannot "address" hardware directly. We have found that ?? will work instead. Meantime I have a similar problem with FP Windows 2.6 trying to change the font on an Epson TMU 220 Receipt printer. Epson's website is singularly unhelpful. I'm waiting on their techies sending me the info I want.

regards

RM
 
Thanks Jrb-Bldr for filling up the missing information.

MBSCSI: I thought you grasped all what have been posted prior to my posting.

You have said
<note>
The standard page is 66 lines per inch.
</note>

Should be:
Standard page is 66(11*6) Lines when printing at 6LPI.
or
Standard page is 88(11*8) Lines when printing at 8LPI.
and so on ...

LPI: means Lines you can print in 1 Inch not 1 Page.
When you set the printer to 72 Lines Per Inch, it means you can print 792 (72*11) lines on a 11 inch page. And after printing 1 Line, it needs 12 times CR/LF(Carriage Return/Line Feed) to reach to the next printing position in stead of just 1. You will have very precise control on positioning within a line. To advance half a line it requires 6 CR/LFs.

I hope it will help you.


Nasib
 
Nasib:

I understand fully what you are saying. I chose the Epson Command set because all of the printers can be set to Epson Emulation to print from the DOS program and this will have NO effect on Windows printing from Windows applications like WORD.

What I did not understand until now was how the

cLPI = chr(27) + 'A' command and how to make it work.

I understand fully it is the number of lines per inch and at the standard settings each CR/LF moves the print head down 1/6 of an inch. I need to change it for just one part of this pre-printed form and then change it back as soon as it is set. Once I move the printhead to fill in the first box, I need to go back to the regular 6 lines per inch.

Now that I understand how the command works, I'll let you know how I make out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top