How to delete the margins?
- Снимок3.jpg (39.7 KiB) Viewed 33228 times
- Снимок4.jpg (32.04 KiB) Viewed 33228 times
- Снимок5.jpg (47.31 KiB) Viewed 33228 times
Code: Select all
uses Printers;
procedure SetPaperSize(PaperSize: Integer);
var ADevice, ADriver, APort: array[0..79] of Char;
ADeviceMode: THandle;
DevMode: PDeviceMode;
begin
Printer.GetPrinter(ADevice,ADriver,APort,ADeviceMode);
if ADeviceMode<>0 then
DevMode := PDeviceMode(GlobalLock(ADeviceMode))
else
raise Exception.Create('Error initializing printer');
DevMode.dmFields := DevMode.dmFields or DM_PAPERSIZE;
DevMode.dmPaperSize := PaperSize;
GlobalUnlock(ADeviceMode);
Printer.SetPrinter(ADevice,ADriver,APort,ADeviceMode);
end;
function GetPaperSize: Integer;
var ADevice, ADriver, APort: array[0..79] of Char;
ADeviceMode: THandle;
DevMode: PDeviceMode;
begin
Printer.GetPrinter(ADevice,ADriver,APort,ADeviceMode);
if ADeviceMode<>0 then begin
DevMode := PDeviceMode(GlobalLock(ADeviceMode))
end
else
raise Exception.Create('Error initializing printer');
Result := DevMode.dmPaperSize;
end;