Link to home
Start Free TrialLog in
Avatar of markrhyman
markrhyman

asked on

Printer (Next Page)

Hello,

I am presently trying to print my Customer's information on a WayBill for shipping.

The waybill is about 4" wide by 10.2" Long ( 110 mm x 280 mm)

I am using the following code to print my info.

Printer.Height = 4 * 1440 ' 10 inch height x 1440 twips per inch
Printer.Width = 10.2 * 1440 ' 5 inch height x 1440 twips per inch

Printer.Font.Size = 10
Printer.CurrentX = 20
Printer.CurrentY = 1650
Printer.Print Me.TextDestinaire.Text

Printer.CurrentX = 20
Printer.CurrentY = 2100
Printer.Print Me.TextAdresse.Text

Printer.CurrentX = 3800
Printer.CurrentY = 2100
Printer.Print Me.TextApp.Text

Printer.CurrentX = 20
Printer.CurrentY = 2600
Printer.Print Me.TextVille.Text

Printer.CurrentX = 2000
Printer.CurrentY = 2600
Printer.Print Me.TextProvince.Text


Printer.CurrentX = 3400
Printer.CurrentY = 2600
Printer.Print Me.TextPostal.Text

Printer.EndDoc

The code runs fine.  However after the EndDoc statement, the printer scrolls through 3 - 4 waybills before stopping and this does not re-align the printhead for the next waybill printing.  Is there a way to tell the printer how many line to jump before stopping or is there a way to make the printer head always align with the next waybill since the paper size is already defined?

I am printing on a dotMatrix Okidata ML 420 since waybills comes on continuous paper.

Thanks for your help.

Mark
Avatar of Erick37
Erick37
Flag of United States of America image

Printer.Height = 4 * 1440 ' 10 inch height x 1440 twips per inch
Printer.Width = 10.2 * 1440 ' 5 inch height x 1440 twips per inch

Your comments above suggest you have the height and width transposed.
Avatar of markrhyman
markrhyman

ASKER

That's true.  I did make the change to:

Printer.Height = 4 * 1440 ' 5 inch height x 1440 twips per inch
Printer.Width = 10.2 * 1440 ' 10 inch height x 1440 twips per inch

Still the problem lies after the printing is done.
try the

Printer.NewPage method?
It seems that I am having trouble setting the papersize.

Check this:

Printer.Height = 4 * 1440  ' 4 inch height x 1440 twips per inch
Printer.Width = 10.2 * 1440 ' 10.2 inch Width x 1440 twips per inch

In the Watch Windows I get:

Printer.Height = 15840
Printer.Width = 12240

Which is totally not what I want.

I even tried to set the printer.papersize = 256 and I get a Runtime Error.

I think this is why I can't have the nextpage aligned correctly.

Any help why I cannot set the Page Size?

Mark
From MSDN:

"Setting a printer's Height or Width property automatically sets PaperSize to vbPRPSUser [256].

Note   The effect of the properties of the Printer object depends on the driver supplied by the printer manufacturer. Some property settings may have no effect, or several different property settings may all have the same effect. Settings outside the accepted range may or may not produce an error. For more information, see the manufacturer's documentation for the specific driver."


In the printers dialog (from Windows) what paper size and orientation is selected for this printer?  Is this the default printer?



Yes this is the default Printer.

The driver is correct and is the latest one downloaded from Okidata.

I am not using the PRinter Dialog for this printing.

I understand. But as a test, can you set the paper size through Windows and not your code.  Comment out the .height and .width lines and test printing.
The closest match for the Height would be Envelope DL but there's no Envelope DL in the properties of the printer.  I tried Envelope #10 which is close to what I want.  The Width and Height changed to the size of the Env #10 in the Watch window in VB.

However, the printer still skips 3 waybills after finishing printing the first one.

This is a mess.  I really need some solution.  I cannot imagine that this cannot be done.

Mark
I did that,

Same story.  Still skips 3 Waybills.

Here's how to setup custom paper sizes in Windows 2k, XP:
http://my.okidata.com/idocs2.nsf/(MOC-ML420)/54E6115E5DBD742C852569B30060485C?OpenDocument

I'm assuming a program like MS Word can print correctly to this printer?
Erick37, I really appreciate your help but I also tried to follow the steps mentionned in the link above.  However the newly created form appreas nowhere.  

Give it a try and let me know if you create a newform and if you can see it in the printer properties afterwards.

I definitely have to get a solution.
It seems to be driver specific...

It appears in the Acrobat Distiller dropdown, but not the HP Laserjet.  Sorry it wasn't helpful.
Ok, here's another thought...

Your printer has a feature called "Forms Tear-Off."  Make sure it's not enabled.


"The Forms Tear-Off feature allows a printed continuous forms page to be torn off without wasting paper or adjusting the printer.

When printing stops, Forms Tear-Off automatically moves the paper to align the perforation with the tear bar (located under the access cover), after a time interval which you select through the menu.

Paper remains in the tear-off position until the printer receives more data. Then, the paper moves back down for printing.

Note: This feature is normally turned off."
I will have to go through the manual because there's a Button on the printer Tear but when I press on this button it aligns the paper to be torn off.

I dunno how to disable this function.

ASKER CERTIFIED SOLUTION
Avatar of Erick37
Erick37
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I wrote to Okidata today in order to know how can I set up a custom form size in the printer.  I even switched to another printer but I ran through the same problem.

This situation is exasperating.

If you find any other solution let me know.  I am willing to raise the points again in order to find a working solution.

Thanks a lot for your support.
Here's the answer from Okidata.  The printer Driver was the problem.  I had to use another one that would accept the created form (Emulation).  Erick37 you were of great help I am going to award you the points.  Thanks.

--------------------------------------  

Mark,

Thank you for your recent inquiry.

I've included instructions on how to create a custom form below.

Before beginning, make sure the Okidata printer is set as default in Windows.

Go to START/SETTINGS/PRINTERS, highlight the printer and select FILE in the upper left corner, and click on SERVER PROPERTIES. In the Print Server Properties window check the box "Create New Form", this will allow you to provide a name for the form. Next, set the form parameters under the Measurements section. Click Save Form and your newly created form will appear in the box above.

Now close the Window.

Next click on File and then click on Printing Preferences. Under the Layout Tab click on the Advanced button. Select the form you just created from the drop down list under Paper Size. Click OK and Close the Printer Preferences window.

Next right click on the printer icon that you will use with the newly created form. Click on Properties and then on the Device Settings tab. Select the form from the drop down list and apply the changes.

The newly created form is now set as the default paper size within the selected Print Driver.

If you continue to have problems, please try an alternate driver. Load the Epson FX 286 driver which is native in Windows. Make sure the emulation of the driver matches the printer.


If we can do anything else for you in the future, please don't hesitate to ask! Also, you may be interested to know that Oki Data has now launched my.okidata.com, which allows you to access Personalized Solutions information for all your Oki Data Products.

Your Personal Solutions Specialist