I want to print data on a pre-printed paper. it's length is 4.25". so I coded like this
Printer.GetPrinter(Adevice,Adriver,Aport,DeviceHandle);
PixelsInInchX:=GetDeviceCaps(Printer.Handle,LOGPIXELSX);
PixelsInInchY:=GetDeviceCaps(Printer.Handle, LOGPIXELSY);
DevMode:=globallock(DeviceHandle);
with DevMode^ do
begin
dmFields := DM_PAPERSIZE or DM_DEFAULTSOURCE or
DM_PAPERWIDTH or DM_PAPERLENGTH;
dmpapersize:=DMPAPER_USER;
dmPaperWidth :=(PixelsInInchX*8.5);
dmPaperLength:=(PixelsInInchY*4.25); //}1101;
end;
printer.SetPrinter(Adevice,Adriver,Aport,DeviceHandle);
But when I run the program the paper length is 612(dmpaperLength returns 612). So I just try to put values and I got my paper size when I put dmPaperLength with 1100 or 1101. The big problem is I want the value between these two values as 1100.5, but I can't put that value because dmPaperLength is an integer type.
It is a pre-printed paper so I must have that size and I want to use that paper in dotmatrix printer.after I print in one page if I don't give my length as correct value the next page data will not be in proper place.
Any body have any idea??
:^)
Printer.GetPrinter(Adevice,Adriver,Aport,DeviceHandle);
PixelsInInchX:=GetDeviceCaps(Printer.Handle,LOGPIXELSX);
PixelsInInchY:=GetDeviceCaps(Printer.Handle, LOGPIXELSY);
DevMode:=globallock(DeviceHandle);
with DevMode^ do
begin
dmFields := DM_PAPERSIZE or DM_DEFAULTSOURCE or
DM_PAPERWIDTH or DM_PAPERLENGTH;
dmpapersize:=DMPAPER_USER;
dmPaperWidth :=(PixelsInInchX*8.5);
dmPaperLength:=(PixelsInInchY*4.25); //}1101;
end;
printer.SetPrinter(Adevice,Adriver,Aport,DeviceHandle);
But when I run the program the paper length is 612(dmpaperLength returns 612). So I just try to put values and I got my paper size when I put dmPaperLength with 1100 or 1101. The big problem is I want the value between these two values as 1100.5, but I can't put that value because dmPaperLength is an integer type.
It is a pre-printed paper so I must have that size and I want to use that paper in dotmatrix printer.after I print in one page if I don't give my length as correct value the next page data will not be in proper place.
Any body have any idea??
:^)