Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

How can I change the print quality (i.e. DRAFT)

edited June 2006 in End User
Hi,

I want to change the print quality settings for a Draft mode inside my
application. I tried to do this using the source code below but it didn?t
work.

Source code - Attempt 1:
var
DevMode: PDeviceMode;
DeviceMode: Cardinal;
begin
ppReport.Printer.GetDevMode(DeviceMode);
DevMode := GlobalLock(DeviceMode);
DevMode^.dmFields := DevMode^.dmFields or DM_PRINTQUALITY;
DevMode^.dmPrintQuality := DMRES_DRAFT;
ppReport.Printer.SetDevMode(DeviceMode);
GlobalUnlock(DeviceMode);
end;


Source code - Attempt 2:
var
FDevice: array[0..255] of char;
FDriver: array[0..255] of char;
FPort: array[0..255] of char;
DeviceMode: THandle;
DevMode: PDeviceMode;
begin
Printer.GetPrinter(FDevice, FDriver, FPort, DeviceMode);
DevMode := GlobalLock(DeviceMode);

if ((DevMode^.dmFields and DM_PRINTQUALITY) = DM_PRINTQUALITY) then
begin
DevMode^.dmFields := DevMode^.dmFields or DM_PRINTQUALITY;
DevMode^.dmPrintQuality := DMRES_DRAFT;
end;
GlobalUnlock(DeviceMode);
FPrinter.SetPrinter(FDevice, FDriver, FPort, DeviceMode);
end;

Any suggestion ??

Thanks,
Priscila

Comments

  • edited June 2006

    Here is an example that I created. (I tested using RB 10.03, if you have an
    earlier version it may or may not work)

    www.digital-metaphors.com/tips/PrintQuality.zip

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2006
    Hi, the example was very usefull.
    Thank you very much :)

    --
    .:: Priscila Tavares Lugon ::. Tecnologia
    Agriness - Gerenciamento para Agroempresas
    (48) 3028-0015 ::. www.agriness.com

This discussion has been closed.