我用过dr200。用qrbarcode控件,quickreport打印,自定义纸张大小。
写了个设置自定义纸张函数配合改变打印机自定义纸张:
function setprnpaper(const wdth,lenth:real):boolean;
var FDevice, FDriver, FPort:array [0..255] of char;
DeviceMode,HPrt:THandle;
DevMode
DeviceMode;
begin
result:=true;
Printer.GetPrinter(FDevice, FDriver, FPort, DeviceMode);
if DeviceMode<=0 then
begin
result:=false;
exit;
end;
DevMode := GlobalLock(DeviceMode);
OpenPrinter(FDevice, HPrt, nil);
begin
DevMode^.dmFields := DevMode^.dmFields or dm_paperlength;
DevMode^.dmPaperLength :=trunc(lenth*10);
DevMode^.dmFields := DevMode^.dmFields or dm_paperwidth;
DevMode^.dmPaperWidth :=trunc(wdth*10);
DevMode^.dmFields := DevMode^.dmFields or dm_papersize;
DevMode^.dmPaperSize := DMPAPER_USER;
end;
SetPrinter(HPrt,0,DevMode,PRINTER_CONTROL_SET_STATUS);
do
cumentProperties(DeviceMode,HPrt,FDevice,DevMode^,DevMode^,DM_IN_BUFFER or DM_UPDATE);
GlobalUnlock(DeviceMode);
ClosePrinter(HPrt);
end;