I can'n to win the margins in preview
Posted: Tue Jun 13, 2017 6:24 am
Hi!
How to delete the margins?
How to delete the margins?
Support forums for TRichView, ScaleRichView, Report Workshop and RVMedia components
https://writeally.com/forums/
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;