How do you set Paper Size for Dot Matrix Printer?

Good Evening,

I have developed a Cheque printing application in VB.NET which will be using an “OKI Microline 390 Turbo” dot matrix printer. I’m using the “Generic / Text Only” driver and have created a custom paper size of 8.5 inches by 7 inches. The paper being used is continuous carbon paper being fed in from the rear of the printer via the tractors.

I have been able to print to this printer successfully from my application, using Epson escape sequences to communicate with the printer.

'Printer - Epson Emulation Escapes
    Public Const eClear As String = Chr(27) + "@" 'Initialize printer
    Public Const eProSpaceON As String = Chr(27) + "!" + Chr(1) 'Start Porportional Spacing 
    Public Const eProSpaceOFF As String = Chr(27) + "!" + Chr(0) 'Stop Porportional Spacing
    Public Const eTypeface As String = Chr(27) + "k" + Chr(122) 'Typeface 0 Roman, 1 Swiss, 2 Courier, 3 Prestige, 7 Orator, 122 Swiss Bold, 124 Gothic
    Public Const ePitch10 As String = Chr(27) + "P" '10 CPI Pitch
    Public Const ePitch12 As String = Chr(27) + "M" '12 CPI Pitch
    Public Const ePitch15 As String = Chr(27) + "g" '15 CPI Pitch
    Public Const eCentre As String = Chr(27) + Chr(97) + "1" 'Center Justification
    Public Const eLeft As String = Chr(27) + Chr(97) + "0" 'Left Justification
    Public Const eRight As String = Chr(27) + Chr(97) + "2" 'Right Justification
    Public Const eHTAB As String = Chr(9) 'Horizontal Tab
    Public Const eBRVPos As String = Chr(27) + "(v" + Chr(2) + Chr(0) + Chr(81) + Chr(2) 'Relative Vertical Postion: BODY START POSITION X inches
    Public Const eFormFeed As String = Chr(12)

    'Body Specific Cheque Alignment
    Public Const eBChqNum As String = Chr(27) + "$" + Chr(104) + Chr(1) '6 inches
    Public Const eBChqDate As String = Chr(27) + "$" + Chr(40) + Chr(0) '1 inch
    Public Const eBN2W As String = Chr(27) + "$" + Chr(120) + Chr(0) '2 inches
    Public Const eBPayTo As String = Chr(27) + "$" + Chr(40) + Chr(0) '1 inch
    Public Const eBRef As String = Chr(27) + "$" + Chr(40) + Chr(0) '1 inch
    Public Const eBAmount As String = Chr(27) + "$" + Chr(52) + Chr(1) '6.5 inches

    'Description Specific Cheque Alignment
    Public Const eDPayTo As String = Chr(27) + "$" + Chr(40) + Chr(0) '1 inch
    Public Const eDSummary As String = Chr(27) + "$" + Chr(40) + Chr(0) '1 inch
    Public Const eDRef As String = Chr(27) + "$" + Chr(40) + Chr(0) '1 inch

Public Sub PrintBody()

        'Prints information for Body of Cheque
        Dim N2WResult As String

        N2WResult = AmountInWords(txtMAmt.Text)

        Print(eClear + eProSpaceON + eTypeface + ePitch12 + eBChqNum + txtMChqNum.Text + vbCrLf + vbCrLf)
        Print(eBChqDate + DateTimePickerM.Text + eBN2W + N2WResult + vbCrLf + vbCrLf + vbCrLf)
        Print(eBPayTo + txtMPayTo.Text)
        Print(eBRef + "REF:" + txtMRef.Text + eBAmount + "*" + txtMAmt.Text + "*")

    End Sub

    Public Sub PrintFooter()

        Dim formattedDate As Date = DateTimePickerM.Text

        'Prints information for Description of Cheque
        Print(eDPayTo + txtMPayTo.Text)
        Print(eDSummary + "CK#" + txtMChqNum.Text + " " + txtMCurr.Text + "$" + txtMAmt.Text + " " + formattedDate.ToString("MMMM dd, yyyy"))
        Print(eDRef + "REF:" + txtMRef.Text)

    End Sub

Open in new window

The area I am stuck on now is setting the page size. I have the manual for this printer but there is no mention of setting the paper size in it.

1. Would I set the paper size within the driver from the below 2 areas?  If so where exactly would I do this for my custom size and how would the syntax look? For example in the “Printer Commands” section I am not sure what I would input in those boxes.

driver properties
The other question I have regarding the paper size is:

2. Since my paper is a custom size and if I configure the size within the driver, how would this work with setting the “Top Of Form” and the “Tear” for the printer (see: as I would think both settings from the driver and printer would conflict with eachother wouldn’t they?

I've played around with settings but since I dont really understand it, I feel like I am just wasting time.

Does anyone know how to do this?

Appreciate any assistance.

Kind Regards,
KevinInformation TechnologyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JohnBusiness Consultant (Owner)Commented:
Here is a solution using a custom form that seems to have worked.

It is an old thread (NT4 Workstation).

Now I print LOTS of cheques. Have you considered voucher cheques?  8.5 x 11. The 8.5 x 7 piece with the cheque goes to the vendor. The remaining piece gets filed with the voucher. Good bookkeeping AND reduces special work.
KevinInformation TechnologyAuthor Commented:
@John, thank you for your prompt response.

What is mentioned in the solution you sent I have already done as stated in my posting, of defining a custom size. However this seems to have no affect and the printer is still using the default paper size of 8.5 x 11 instead of my custom size of 8.5 x 7.

Do you have any other ideas you could share with me?

Thank you also for your suggestion regarding the voucher check, I do know that management was looking in to this, but for whatever reason decided not to go with it.

Kind Regards,
KevinInformation TechnologyAuthor Commented:
@John, I was able to resolve the problem by setting the paper size on the printer itself.

The PDF manual for the "OKI ML390 Turbo Dot Matrix" printer I have was downloaded from OKI but it appears to be incomplete, as I found an Online manual which explains how to set the paper size directly from the physical printer. This information is missing/not included in the PDF manual I have.

Below is the URL on how to accomplish this:

After making the modifications on the physical printer by following the above online documentation, I printed the settings page that's stored in the printers memory and it's now set to my custom page size.

printer settings
So now everything is working perfectly.

Kind Regards,

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KevinInformation TechnologyAuthor Commented:
Reason for accepting my own comment as the solution is that I was able to resolve the issue on my own.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Printers and Scanners

From novice to tech pro — start learning today.