PDA

Click to See Complete Forum and Search --> : Controlling a printer...


logmuaddib
Jan 24th, 2000, 02:43 PM
Hello all,
I have made a POS database prog for a local comapany. I have run into problems with controlling the dot-matrix printers which would print the sales invoices. This is on a network too. Anyways, trying to deal with multiple printers, each a different manufacturer/brand and model can cause a lot of headaches... :-(

k, the prob: with 1 printer, the ouput is perfect in all regards. But sense the other printer is a different brand and the feed length is different I cannot duplicate this perfect output on the 2nd printer. Uh, the columns, spacing and quailty are fine, its just the feed length is screwed up. So is it possible to tell this printer to feed the paper a couple of lines and then print the invoice? Is it possible to control the feed on a printer in vb6? After you tear off the invoice from the printer, the position of the printer when its told to print the next invoice will cause it to be mis-aligned.

Any thoughts/ideas would be appreciated...

Frank

raicheman
Jan 25th, 2000, 12:12 AM
Add A common dialog box to the program and run a bit of code like so to determine what printer is being used:

For Each xPrinter In Printers
If xPrinter.DeviceName = Printer.DeviceName Then
Set Printer = xPrinter
Printer.FontName = Default
'below sets the font for selected printer
Printer.FontName = "Courier New"
Printer.FontSize = 11
Printer.PrintQuality = vbPRPQDraft
'below shows user and programmer what the default printer is and what font is being used and the size and the quality It will not show at run time
MsgBox "Printer.PrintQuality = " & Printer.PrintQuality & " Printer.fontname = " & Printer.FontName & " and printer.fontsize = " & Printer.FontSize & " Printer.DeviceName = " & Printer.DeviceName
' Stop looking for a printer.
Exit For
End If
Next


Then use an if statement for .devicename or whatever and add a couple of lines before it prints if need be.