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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Object for VFP 1

Status
Not open for further replies.

sigma123

Programmer
Nov 30, 2001
6
0
0
CO
Hi

Anybody knows how can i use the object printer in VFP, i know that object exists in VB but is there a way to work in VFP?

Thanks in advance.
 
Ok Mike

I need to print a magnetic band in a card printer, i found a code in VB that use a printer object, and a need do the same in VFP, with this printer object i cant directly send command to printer.

This is the code in VB.


CommonDialog1.ShowPrinter 'Use the common dialog so that changes
'may be made to the driver
Printer.ScaleMode = 6 'Vb millimeters
Printer.CurrentX = 0 'Left, be aware of driver's orientation
Printer.CurrentY = 0 'Top, be aware of driver's orientation
Printer.FontName = "System"
'Tilde, track number method is used to send magnetic encoding data
'These two characters inform the driver to create encoding commands
'The next two lines will encode but do not print.
Printer.Print "~1" & txtAcct 'track 1, Alphanumeric allowed
Printer.Print "~2" & txtAcct 'track 2, numeric only
'Track three is not shown in this example
Printer.PaintPicture Picture1.Picture, 40, 12, 35, 35
'Use any true type font to print on the card
Printer.Font.Name = "Arial"
Printer.FontBold = False
Printer.FontSize = 16
Printer.CurrentX = 12
Printer.CurrentY = 12
Printer.Print txtFname
Printer.CurrentX = 12
Printer.CurrentY = 24
Printer.Print txtLname
Printer.CurrentX = 12
Printer.CurrentY = 36
Printer.Print txtAcct
'No barcode sent, see 010109-000004 click assist example if needed
Printer.EndDoc 'This line sends the job to the driver
 
Sigma,

There are two ways of doing this in VFP. First, the @ / SAY command will let you print at precise positions on the page -- the positions are measured in characters, though, rather than pixels.

Also, ??? will let you send any command to the printer, bypassing the printer driver. If you know the printer's command language, you can use this to finely control the printer.

If you just want to brint bar codes, the easiest way is to acquire a barcode font. I have done that in the past, and it is simple.

M ike


Mike Lewis
Edinburgh, Scotland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top