• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

Direct Print to Dotmatrix with special forms control

I need to print a special form size (7" in length) on a dotmatix printer.  I would like to be able to send control characters and text directly to the printer.  How can I best do this?
1 Solution
You can open the printer's port using Open, just as you would open file:

Open "LPT1" for output as #1

'Then, you just use Print # to send strings to it
Each printer have their own code, do you have them?
MikeP is right
dabellei, if the printer is EPSON compatible then it shoud respect the stadard ESC/P control codes.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

dlwallacAuthor Commented:
If this is what you are suggesting, it does not work.

Private Sub Command1_Click()
' Truck Bill Form Description
' Form size: 8.5 in. width, 7 in. height
' 8 lpi, 56 lines per page
' 10 characters per inch
' Using IBM ProPrinter (or any IBM control character compatible)

   Dim fa As Integer
   Dim x As Integer
   fa = FreeFile
   Open "lpt1" For Output As fa
   ' Set page size to 56 lines, 8 lines per inch
   Print #fa, Chr$(27); "C"; Chr$(56); Chr$(27); Chr$(48);
   For y = 1 To 2                       ' print 2 pages
      For x = 1 To 30                   ' print first 30 lines
         Print #fa, Format$(x, "##0")
      Next x
      Print #fa, Chr$(12);              ' eject to new page
   Next y
   Close fa
End Sub

Before I analize the code, tell me whats the concrete problem, what is wrong?. Any error messages, or what?
IBM is different from EPSON!

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now