When printing with the Printer Object - is there a way to cut-off the page at a certain height . for e.g, cut the page off at 3 inches?
Is there ANY way to do it, be it with or without the Printer object?
Saad
passel
09-03-2003, 07:06 AM
You can try to change the Printer.Height value, but this depends on the
driver accepting changes to the Height and Width.
There are 1440 twips per inch, so:
Printer.Height = Printer.Height - (1440*3)
should make the assumed paper height, 3 inches shorter.
The driver may ignore changes to Height and Width, so you may have
to monitor the CurrentX and CurrentY values.
Add code similiar to this before you print each line.
If Printer.CurrentY + Printer.TextHeight("X") > (Printer.Height-(1440*3)) then
Printer.NewPage
end if
A-Dam
09-03-2003, 08:14 PM
I'm not really sure what you mean. If you only want printing on the top 3 inches of a page:
Printer.ScaleMode = vbInches
If Printer.CurrentY >= 3 Then Printer.NewPage
If you want want to keep the top 3 inches blank, then you will have to keep checking the Printer.Page property. When a new page is started, before printing anything call Printer.CurrentY = 3
What's happening is that I have a Custom mini printer that prints on a page that's about 2 inches wide. When I print from a VB program - the printing just keeps on going on & on .. and it never actually cuts the page. The page should cut off at about 4 inches - and I'm trying to adjust it so that it can be cut off at 3, 3 1/2, 5 inches etc. - set it to anything desirable .
I'm not getting the Printer.Height to change - it remains at a constant 5440 twips even if I set it to something else . It doesn't give an error or anything
Would Printer.Height actually cut the paper off. Apparently, it's not cutting it at 5440 twips either.
Please advise.
Thanks.
Saad
passel
09-04-2003, 08:08 PM
I don't know. It's probably up to the driver, just like it is up to the
driver whether it will act on a change in height or not. In your case, it
seems like it will not respond to a change in height.
If you print, and then do a Printer.NewPage, or a Printer.EndDoc, does
it cut the page. If not, then there is probably some "escape sequence"
that must be sent to the printer, in order for it to cut the page. Since
the printer buffer is usually not flushed to the printer until either the
NewPage, EndDoc, or a print to a CurrentY below the end of the page is
done, I don't know when it would be safe to send the "escape sequence"
(assuming there is one). With the Windows driver, should you send it
before the NewPage, after the NewPage, after setting CurrentY to some value, doing a Printer.Print " "; and then the "cut", etc...
You need to find documentation to see how the cut is initiated, since
this is a continuous feed roll.