Set a custom page size

From: Daniel Crespo (dcrespo_at_grupozoom.com)
Date: 02/01/05


Date: Tue, 1 Feb 2005 12:14:53 -0400

Here is the infrastructure:
A network with either Win98 and WinXP machines, and printers attached to the
network (it may be through a computer (W98 or WXP) or directly to the
network). A fact is that I can't control where the printer will be connected
to and from what computer the user will print an invoice.

What I want:
Print an invoice with 1/3 of a Letter height in a dot matrix printer from
any computer with win98 or winXP to any computer with win98 and winXP. Not
always the user will print that invoice in a certain printer, so I want the
program to automatically set the page size, print, and back, without
changing the defaults printer preferences of the computer where the printing
occured.

What I did:
Under WinXP, you must create a page form (like A4, Letter, etc.) in order to
use it. Actually, I create a page form with the dimensions 219cms width and
93cms (this is the 3rd part of the total height of a Letter page) height,
and print perfect either in an Epson LX-300 and Epson LX-300+ (I mean, it
stops exactly at 93cms height, and if I send another print action, it
continues exactly where it stopped... It fits perfect the invoice draws with
a lot of printings). The creation of the page form works almost perfect when
is in the local computer, but if you want to print in another WinXP machine,
it has to have the page form respectively in order to use it. So, if there
isn't the page form, it has to be created, and for this you have to get the
"rights" to do it on that remote machine. To do this is a lot of headache.

In the other hand, under Win98, you only set the Printer.Height and
Printer.Width to the preferred values and should be all. The printer object
works with the printer driver, so it's values depends directly on the
printer driver. The problem here is that when I set Printer.Height = 5280,
VB (or the driver) sets it to another number, like 5270 (this is the nearest
number I obtanied).

There's a difference betweent WinXP and Win98 in the way that each one
prints out a page on a printer. WinXP uses (as I note) a page form resident
on the remote machine, it means, it uses the remote drivers. Win98 uses the
local drivers to do the print job, even if the printer resides in a WinXP
machine.

My test cases:
1. From WinXP to WinXP: Perfect, except if the page form doesn't exist in
the remote computer.
2. From Win98 to Win98: Unperfect. The height isn't what I specify. VB (or
the local driver) reset it.
3. From Win98 to WinXP: Unperfect. Exactly the "From Win98 to Win98" case.
4. From WinXP to Win98: Perfect. Unexplainable. My code, theorethically
creates a Page Form on the printer server (in this case is a Win98 system)
and print the invoice with the exact dimensions.

The problem, obviosuly, is under Win98. I think that IF I can print from
WinXP to Win98 almost perfect, AND (note the caps) I can print from Win98
WITH HIS OWN DRIVERS in a WinXP computer, THEN there must be a way to either
use a local driver and print remotely (Cases 2. and 3.), and set an exact
dimensions to the page size to the printer, no matter where it is connected
(Cases 1. and 4.).
So, the printer can do it! I just have to know how to communicate with the
printer with the actual tools, and I think that it can be done with api
calls.

I hope there's a brilliant mind out there :)



Relevant Pages

  • Re: win98 and winxp Remote desktop
    ... Any error messages when you try to connect from the W98 machine? ... can not no matter what I try get the win98 to log into the winxp as ... the remote desltop client. ...
    (microsoft.public.windowsxp.work_remotely)
  • Re: is that possible to run winXP with win98???
    ... I would like to setup a page to choose loading Win98 or XP. ... My WinXP drive had set as primary master and win98 as primary slave. ... Install Windows 98 after XP is Installed. ... The simplest way I've found to dual boot between Win9x/Me and WinXP would be to partition your driveroughly as follows: ...
    (microsoft.public.windowsxp.general)
  • My old scanner does no more work...
    ... After upgrading from Win98 to WinXP my old Genius Color-Page ... there is no driver for WinXP ...
    (microsoft.public.windowsxp.general)
  • Re: Data loss: problem with copying files from Win98 to XP (FAT32) and vice-versa
    ... After some time I've "discovered" unused 20 GB on that disk so I've formatted it in WinXP. ... in Win98 I couldn't see the files that I copied on that disk in WinXP. ... Because then I closed Win98 and started up WinXP I couldn't see any folder on the disk from XP. ...
    (microsoft.public.windowsxp.general)
  • Data loss: problem with copying files from Win98 to XP (FAT32) and vice-versa
    ... After some time I've "discovered" unused 20 GB on that disk so I've ... Win98 I couldn't see the files that I copied on that disk in WinXP. ... I moved only one folder. ...
    (microsoft.public.windowsxp.general)