Printers, added support to specify printing resolution, cups

git-svn-id: trunk@19095 -
This commit is contained in:
jesus 2009-03-25 05:35:55 +00:00
parent 2884421c60
commit 68eddde845
5 changed files with 339 additions and 182 deletions

View File

@ -10,12 +10,14 @@ uses udlgSelectPrinter,udlgpropertiesprinter, FileUtil;
//Return always 72 because, PostScript it's 72 only //Return always 72 because, PostScript it's 72 only
function TCUPSPrinter.GetXDPI: Integer; function TCUPSPrinter.GetXDPI: Integer;
begin begin
//Result:=InternalGetResolution(True);
Result:=72; Result:=72;
end; end;
//Return always 72 because, PostScript it's 72 only //Return always 72 because, PostScript it's 72 only
function TCUPSPrinter.GetYDPI: Integer; function TCUPSPrinter.GetYDPI: Integer;
begin begin
//Result:=InternalGetResolution(False);
Result:=72; Result:=72;
end; end;
@ -91,6 +93,33 @@ begin
end; end;
end; end;
function TCUPSPrinter.GetResolutionOption: string;
var
L1,L2: TStringlist;
i: Integer;
begin
Result := Self.cupsGetOption('Resolution');
if Result='' then
begin
// get resolution from ppd
Result := GetPPDAttribute('DefaultResolution');
if Result='' then
begin
// try grouped options
L1 := TStringList.Create;
L2 := TStringList.Create;
try
i := EnumPPDChoice(L1,'Resolution',L2);
if i>=0 then
Result := L2[i]
finally
L2.Free;
L1.Free;
end;
end;
end;
end;
procedure TCUPSPrinter.GetDebugOptions(Lst : TStrings); procedure TCUPSPrinter.GetDebugOptions(Lst : TStrings);
Var Opts : Pcups_option_t; Var Opts : Pcups_option_t;
Opt : Pcups_option_t; Opt : Pcups_option_t;
@ -214,6 +243,54 @@ begin
result := fCupsPapersCount>0; result := fCupsPapersCount>0;
end; end;
function TCUPSPrinter.InternalGetResolution(ForX: boolean): Integer;
procedure ParseResolution(s:string);
var
a,b: Integer;
begin
if s<>'' then begin
s := uppercase(s);
a := pos('X', S);
b := pos('D', S);
if b=0 then
b := Length(S)
else
dec(b);
if a>0 then begin
// NNNXMMMDPI (or NNN X MMM DPI)
FCachedResolution.x := StrToIntDef(trim(copy(S,1,a-1)), 0);
FCAchedResolution.y := StrToIntDef(trim(copy(S,a+1,b)), 0);
end else begin
// NNNDPI (or NNN DPI);
FCachedResolution.x := StrToIntDef(trim(copy(S,1,b)), 0);
FCachedResolution.y := FCachedResolution.x;
end;
end;
end;
begin
if not (cpsResolutionValid in FStates) then begin
// check user defined resolution
FCachedResolution.x := 0;
FCachedResolution.y := 0;
ParseResolution(GetResolutionOption);
if (FCachedResolution.x=0) or (FCachedResolution.y=0) then
begin
FCachedResolution.x := 300;
FCachedResolution.y := 300;
end;
include(FStates, cpsResolutionValid);
end;
if ForX then
result := FCachedResolution.X
else
result := FCachedResolution.Y;
end;
//Print the file aFileName with a selected printer an options //Print the file aFileName with a selected printer an options
function TCUPSPrinter.PrintFile(aFileName: String): longint; function TCUPSPrinter.PrintFile(aFileName: String): longint;
var PrinterName : string; var PrinterName : string;
@ -395,6 +472,48 @@ begin
end; end;
end; end;
function TCUPSPrinter.GetPPDAttribute(const aName: string): string;
var
i : integer;
AttrRoot : PPppd_attr_t;
Attr : Pppd_attr_t;
begin
Result:='';
if not CUPSLibInstalled then
Exit;
if (Printers.Count>0) and (fcupsPrinter<>nil) and (fcupsPPD<>nil) then
begin
{
WriteLn('PPD INFO: ');
WriteLn(' Model : ', fcupsPPD^.modelname);
WriteLn(' ModelNumber : ', fcupsPPD^.model_number);
WriteLn(' Manufacturer : ', fcupsPPD^.manufacturer);
WriteLn(' Nickname : ', fcupsPPD^.nickname);
WriteLn(' Product : ', fcupsPPD^.product);
WriteLn(' ShortNickName : ', fcupsPPD^.shortnickname);
WriteLn(' Attributes : ', fcupsPPD^.num_attrs,' Current=',fcupsPPD^.cur_attr);
}
i := 0;
AttrRoot := fCupsPPD^.attrs;
while (AttrRoot<>nil) and (i<fcupsPPD^.num_attrs) do
begin
Attr := AttrRoot^;
if attr<>nil then
begin
//WriteLn(' i=',i,' Name=',Attr^.Name,' Spec=',Attr^.Spec,' Value=',Attr^.Value);
if (StrComp(pchar(AName), Attr^.name)=0) then
begin
result := attr^.value;
break;
end;
end;
inc(i);
inc(AttrRoot);
end;
end;
end;
procedure TCUPSPrinter.GetEnumAttributeString(aName: PChar; Lst: TStrings); procedure TCUPSPrinter.GetEnumAttributeString(aName: PChar; Lst: TStrings);
var var
Reponse : Pipp_t; //IPP Reponse Reponse : Pipp_t; //IPP Reponse

View File

@ -63,7 +63,8 @@ type
cpsOrientationValid, cpsOrientationValid,
cpsPaperNameValid, cpsPaperNameValid,
cpsCopiesValid, cpsCopiesValid,
cpsPaperRectValid cpsPaperRectValid,
cpsResolutionValid
); );
TCUPSPrinterStates = set of TCUPSPrinterState; TCUPSPrinterStates = set of TCUPSPrinterState;
@ -96,6 +97,7 @@ type
FBeginDocCount: Integer; FBeginDocCount: Integer;
fRawModeStream: TMemoryStream; fRawModeStream: TMemoryStream;
FOutputFilename: string; FOutputFilename: string;
fCachedResolution: TPoint;
function GetCupsRequest : Pipp_t; function GetCupsRequest : Pipp_t;
procedure DoCupsConnect; procedure DoCupsConnect;
@ -110,6 +112,7 @@ type
function InternalGetCurPaperName: string; function InternalGetCurPaperName: string;
procedure InternalGetPaperRect(aPaperName:string; var PaperRect:TPaperRect); procedure InternalGetPaperRect(aPaperName:string; var PaperRect:TPaperRect);
function CupsPapersListValid: boolean; function CupsPapersListValid: boolean;
function InternalGetResolution(ForX: boolean): Integer;
protected protected
function GetCanvasRef : TPrinterCanvasRef; override; function GetCanvasRef : TPrinterCanvasRef; override;
@ -152,9 +155,11 @@ type
function GetAttributeBoolean(aName : PChar; DefaultValue : Boolean) : Boolean; function GetAttributeBoolean(aName : PChar; DefaultValue : Boolean) : Boolean;
function EnumPPDChoice(Lst : TStrings; const aKeyWord : string; function EnumPPDChoice(Lst : TStrings; const aKeyWord : string;
OptNames: TStrings = nil) : Integer; OptNames: TStrings = nil) : Integer;
function GetPPDAttribute(const aName: string): string;
procedure cupsAddOption(aName,aValue: string); procedure cupsAddOption(aName,aValue: string);
function cupsGetOption(aKeyWord: string): String; function cupsGetOption(aKeyWord: string): String;
function GetResolutionOption: string;
public public
constructor Create; override; constructor Create; override;
destructor Destroy; override; destructor Destroy; override;

View File

@ -1,20 +1,20 @@
object dlgpropertiesprinter: Tdlgpropertiesprinter object dlgpropertiesprinter: Tdlgpropertiesprinter
Left = 333 Left = 228
Height = 417 Height = 464
Top = 111 Top = 63
Width = 457 Width = 457
HorzScrollBar.Page = 456
VertScrollBar.Page = 416
ActiveControl = PagesProperties ActiveControl = PagesProperties
Caption = 'Printer properties' Caption = 'Printer properties'
ClientHeight = 417 ClientHeight = 464
ClientWidth = 457 ClientWidth = 457
OnCreate = dlgpropertiesprinterCREATE OnCreate = dlgpropertiesprinterCREATE
OnDestroy = FormDestroy OnDestroy = FormDestroy
OnShow = dlgpropertiesprinterSHOW OnShow = dlgpropertiesprinterSHOW
LCLVersion = '0.9.27'
object Panel1: TPanel object Panel1: TPanel
Left = 0
Height = 41 Height = 41
Top = 376 Top = 423
Width = 457 Width = 457
Align = alBottom Align = alBottom
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
@ -49,98 +49,106 @@ object dlgpropertiesprinter: Tdlgpropertiesprinter
end end
end end
object PagesProperties: TNotebook object PagesProperties: TNotebook
Height = 376 Left = 0
Height = 423
Top = 0
Width = 457 Width = 457
Align = alClient Align = alClient
PageIndex = 1 PageIndex = 0
TabOrder = 1 TabOrder = 1
object pgGeneral: TPage object pgGeneral: TPage
Caption = 'General' Caption = 'General'
ClientWidth = 453 ClientWidth = 453
ClientHeight = 345 ClientHeight = 394
object labPaperSize: TLabel object labPaperSize: TLabel
Left = 15 Left = 15
Height = 20 Height = 16
Top = 19 Top = 19
Width = 66 Width = 63
Caption = 'Paper size' Caption = 'Paper size'
ParentColor = False ParentColor = False
end end
object labPaperType: TLabel object labPaperType: TLabel
Left = 15 Left = 15
Height = 20 Height = 16
Top = 55 Top = 55
Width = 69 Width = 64
Caption = 'Paper type' Caption = 'Paper type'
ParentColor = False ParentColor = False
end end
object labPaperSrc: TLabel object labPaperSrc: TLabel
Left = 15 Left = 15
Height = 20 Height = 16
Top = 92 Top = 92
Width = 84 Width = 78
Caption = 'Paper source' Caption = 'Paper source'
ParentColor = False ParentColor = False
end end
object labResolution: TLabel
Left = 15
Height = 16
Top = 125
Width = 62
Caption = 'Resolution'
ParentColor = False
end
object cbPaperSize: TComboBox object cbPaperSize: TComboBox
Left = 131 Left = 130
Height = 25 Height = 27
Top = 11 Top = 9
Width = 309 Width = 310
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] AutoComplete = False
DropDownCount = 10 DropDownCount = 10
MaxLength = 0 ItemHeight = 0
ItemWidth = 0
OnKeyPress = cbPaperSizeKEYPRESS OnKeyPress = cbPaperSizeKEYPRESS
ParentCtl3D = False
Style = csDropDownList Style = csDropDownList
TabOrder = 0 TabOrder = 0
end end
object cbPaperType: TComboBox object cbPaperType: TComboBox
Left = 131 Left = 130
Height = 25 Height = 27
Top = 47 Top = 45
Width = 309 Width = 310
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] AutoComplete = False
MaxLength = 0 ItemHeight = 0
ItemWidth = 0
OnKeyPress = cbPaperSizeKEYPRESS OnKeyPress = cbPaperSizeKEYPRESS
ParentCtl3D = False
Style = csDropDownList Style = csDropDownList
TabOrder = 1 TabOrder = 1
end end
object cbPaperSrc: TComboBox object cbPaperSrc: TComboBox
Left = 131 Left = 130
Height = 25 Height = 27
Top = 81 Top = 81
Width = 309 Width = 310
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] AutoComplete = False
MaxLength = 0 ItemHeight = 0
ItemWidth = 0
OnKeyPress = cbPaperSizeKEYPRESS OnKeyPress = cbPaperSizeKEYPRESS
ParentCtl3D = False
Style = csDropDownList Style = csDropDownList
TabOrder = 4 TabOrder = 4
end end
object gbOrientation: TGroupBox object gbOrientation: TGroupBox
Left = 14 Left = 15
Height = 119 Height = 119
Top = 123 Top = 169
Width = 233 Width = 233
Caption = ' Orientation ' Caption = ' Orientation '
ClientHeight = 100 ClientHeight = 102
ClientWidth = 229 ClientWidth = 229
ParentCtl3D = False
TabOrder = 6 TabOrder = 6
object imgOrientation: TImage object imgOrientation: TImage
Left = 167 Left = 167
Height = 48 Height = 48
Top = 25 Top = 25
Width = 52 Width = 52
Transparent = False
end end
object rbPortrait: TRadioButton object rbPortrait: TRadioButton
Left = 7 Left = 7
Height = 22 Height = 21
Top = 5 Top = 5
Width = 71 Width = 65
AllowGrayed = True AllowGrayed = True
Caption = 'Portrait' Caption = 'Portrait'
Checked = True Checked = True
@ -151,60 +159,61 @@ object dlgpropertiesprinter: Tdlgpropertiesprinter
end end
object rbLandscape: TRadioButton object rbLandscape: TRadioButton
Left = 7 Left = 7
Height = 22 Height = 21
Top = 29 Top = 29
Width = 93 Width = 86
AllowGrayed = True AllowGrayed = True
Caption = 'Landscape' Caption = 'Landscape'
DragCursor = crDefault DragCursor = crDefault
OnClick = rbPortraitCLICK OnClick = rbPortraitCLICK
TabOrder = 1 TabOrder = 1
TabStop = False
end end
object rbrev_Landscape: TRadioButton object rbrev_Landscape: TRadioButton
Left = 7 Left = 7
Height = 22 Height = 21
Top = 53 Top = 53
Width = 143 Width = 132
AllowGrayed = True AllowGrayed = True
Caption = 'Reverse landscape' Caption = 'Reverse landscape'
DragCursor = crDefault DragCursor = crDefault
OnClick = rbPortraitCLICK OnClick = rbPortraitCLICK
TabOrder = 2 TabOrder = 2
TabStop = False
end end
object rbrev_portrait: TRadioButton object rbrev_portrait: TRadioButton
Left = 7 Left = 7
Height = 22 Height = 21
Top = 77 Top = 77
Width = 125 Width = 113
AllowGrayed = True AllowGrayed = True
Caption = 'Reverse portrait' Caption = 'Reverse portrait'
DragCursor = crDefault DragCursor = crDefault
OnClick = rbPortraitCLICK OnClick = rbPortraitCLICK
TabOrder = 3 TabOrder = 3
TabStop = False
end end
end end
object gbDuplex: TGroupBox object gbDuplex: TGroupBox
Left = 255 Left = 256
Height = 119 Height = 119
Top = 123 Top = 169
Width = 185 Width = 185
Caption = ' Duplex printing ' Caption = ' Duplex printing '
ClientHeight = 100 ClientHeight = 102
ClientWidth = 181 ClientWidth = 181
ParentCtl3D = False
TabOrder = 2 TabOrder = 2
object imgDuplex: TImage object imgDuplex: TImage
Left = 126 Left = 126
Height = 52 Height = 52
Top = 21 Top = 21
Width = 44 Width = 44
Transparent = False
end end
object rbDuplexNone: TRadioButton object rbDuplexNone: TRadioButton
Left = 14 Left = 14
Height = 22 Height = 21
Top = 5 Top = 5
Width = 58 Width = 53
AllowGrayed = True AllowGrayed = True
Caption = 'None' Caption = 'None'
Checked = True Checked = True
@ -215,100 +224,99 @@ object dlgpropertiesprinter: Tdlgpropertiesprinter
end end
object rbDuplexLong: TRadioButton object rbDuplexLong: TRadioButton
Left = 14 Left = 14
Height = 22 Height = 21
Top = 29 Top = 29
Width = 91 Width = 83
AllowGrayed = True AllowGrayed = True
Caption = 'Long edge' Caption = 'Long edge'
DragCursor = crDefault DragCursor = crDefault
OnClick = rbPortraitCLICK OnClick = rbPortraitCLICK
TabOrder = 1 TabOrder = 1
TabStop = False
end end
object rbDuplexShort: TRadioButton object rbDuplexShort: TRadioButton
Left = 14 Left = 14
Height = 22 Height = 21
Top = 53 Top = 53
Width = 95 Width = 86
AllowGrayed = True AllowGrayed = True
Caption = 'Short edge' Caption = 'Short edge'
DragCursor = crDefault DragCursor = crDefault
OnClick = rbPortraitCLICK OnClick = rbPortraitCLICK
TabOrder = 2 TabOrder = 2
TabStop = False
end end
end end
object gbBanners: TGroupBox object gbBanners: TGroupBox
Left = 15 Left = 16
Height = 96 Height = 96
Top = 247 Top = 293
Width = 232 Width = 232
Caption = ' Banners ' Caption = ' Banners '
ClientHeight = 77 ClientHeight = 79
ClientWidth = 228 ClientWidth = 228
ParentCtl3D = False
TabOrder = 3 TabOrder = 3
object labBanStart: TLabel object labBanStart: TLabel
Left = 6 Left = 6
Height = 13 Height = 16
Top = 9 Top = 9
Width = 26 Width = 29
Caption = 'Start' Caption = 'Start'
ParentColor = False ParentColor = False
end end
object labBanEnd: TLabel object labBanEnd: TLabel
Left = 6 Left = 6
Height = 13 Height = 16
Top = 49 Top = 49
Width = 23 Width = 24
Caption = 'End' Caption = 'End'
ParentColor = False ParentColor = False
end end
object cbBanStart: TComboBox object cbBanStart: TComboBox
Left = 94 Left = 94
Height = 25 Height = 27
Top = 1 Top = 1
Width = 128 Width = 128
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] AutoComplete = False
MaxLength = 0 ItemHeight = 0
ItemWidth = 0
OnKeyPress = cbPaperSizeKEYPRESS OnKeyPress = cbPaperSizeKEYPRESS
ParentCtl3D = False
Style = csDropDownList Style = csDropDownList
TabOrder = 0 TabOrder = 0
end end
object cbBanEnd: TComboBox object cbBanEnd: TComboBox
Left = 94 Left = 94
Height = 25 Height = 27
Top = 41 Top = 41
Width = 128 Width = 128
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending] AutoComplete = False
MaxLength = 0 ItemHeight = 0
ItemWidth = 0
OnKeyPress = cbPaperSizeKEYPRESS OnKeyPress = cbPaperSizeKEYPRESS
ParentCtl3D = False
Style = csDropDownList Style = csDropDownList
TabOrder = 1 TabOrder = 1
end end
end end
object gbPagesSheet: TGroupBox object gbPagesSheet: TGroupBox
Left = 255 Left = 256
Height = 96 Height = 96
Top = 247 Top = 293
Width = 185 Width = 185
Caption = ' Pages per sheet ' Caption = ' Pages per sheet '
ClientHeight = 77 ClientHeight = 79
ClientWidth = 181 ClientWidth = 181
ParentCtl3D = False
TabOrder = 5 TabOrder = 5
object imgPageSheet: TImage object imgPageSheet: TImage
Left = 78 Left = 78
Height = 50 Height = 50
Top = 17 Top = 17
Width = 80 Width = 80
Transparent = False
end end
object rbSheet1: TRadioButton object rbSheet1: TRadioButton
Left = 6 Left = 6
Height = 22 Height = 21
Top = 5 Top = 5
Width = 32 Width = 30
AllowGrayed = True AllowGrayed = True
Caption = '1' Caption = '1'
Checked = True Checked = True
@ -319,27 +327,41 @@ object dlgpropertiesprinter: Tdlgpropertiesprinter
end end
object rbSheet2: TRadioButton object rbSheet2: TRadioButton
Left = 6 Left = 6
Height = 22 Height = 21
Top = 25 Top = 25
Width = 32 Width = 30
AllowGrayed = True AllowGrayed = True
Caption = '2' Caption = '2'
DragCursor = crDefault DragCursor = crDefault
OnClick = rbPortraitCLICK OnClick = rbPortraitCLICK
TabOrder = 1 TabOrder = 1
TabStop = False
end end
object rbSheet4: TRadioButton object rbSheet4: TRadioButton
Left = 6 Left = 6
Height = 22 Height = 21
Top = 46 Top = 46
Width = 32 Width = 30
AllowGrayed = True AllowGrayed = True
Caption = '4' Caption = '4'
DragCursor = crDefault DragCursor = crDefault
OnClick = rbPortraitCLICK OnClick = rbPortraitCLICK
TabOrder = 2 TabOrder = 2
TabStop = False
end end
end end
object cbResolution: TComboBox
Left = 130
Height = 27
Top = 117
Width = 310
AutoComplete = False
ItemHeight = 0
ItemWidth = 0
OnKeyPress = cbPaperSizeKEYPRESS
Style = csDropDownList
TabOrder = 7
end
end end
object pgMarge: TPage object pgMarge: TPage
Caption = 'Borders' Caption = 'Borders'

View File

@ -1,95 +1,95 @@
{ This is an automatically generated lazarus resource file } { This is an automatically generated lazarus resource file }
LazarusResources.Add('Tdlgpropertiesprinter','FORMDATA',[ LazarusResources.Add('Tdlgpropertiesprinter','FORMDATA',[
'TPF0'#21'Tdlgpropertiesprinter'#20'dlgpropertiesprinter'#4'Left'#3'M'#1#6'He' 'TPF0'#21'Tdlgpropertiesprinter'#20'dlgpropertiesprinter'#4'Left'#3#228#0#6'H'
+'ight'#3#161#1#3'Top'#2'o'#5'Width'#3#201#1#18'HorzScrollBar.Page'#3#200#1#18 +'eight'#3#208#1#3'Top'#2'?'#5'Width'#3#201#1#13'ActiveControl'#7#15'PagesPro'
+'VertScrollBar.Page'#3#160#1#13'ActiveControl'#7#15'PagesProperties'#7'Capti' +'perties'#7'Caption'#6#18'Printer properties'#12'ClientHeight'#3#208#1#11'Cl'
+'on'#6#18'Printer properties'#12'ClientHeight'#3#161#1#11'ClientWidth'#3#201 +'ientWidth'#3#201#1#8'OnCreate'#7#26'dlgpropertiesprinterCREATE'#9'OnDestroy'
+#1#8'OnCreate'#7#26'dlgpropertiesprinterCREATE'#9'OnDestroy'#7#11'FormDestro' +#7#11'FormDestroy'#6'OnShow'#7#24'dlgpropertiesprinterSHOW'#10'LCLVersion'#6
+'y'#6'OnShow'#7#24'dlgpropertiesprinterSHOW'#0#6'TPanel'#6'Panel1'#6'Height' +#6'0.9.27'#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Height'#2')'#3'Top'#3#167#1#5
+#2')'#3'Top'#3'x'#1#5'Width'#3#201#1#5'Align'#7#8'alBottom'#7'Anchors'#11#6 +'Width'#3#201#1#5'Align'#7#8'alBottom'#7'Anchors'#11#6'akLeft'#8'akBottom'#0
+'akLeft'#8'akBottom'#0#12'ClientHeight'#2')'#11'ClientWidth'#3#201#1#11'Full' +#12'ClientHeight'#2')'#11'ClientWidth'#3#201#1#11'FullRepaint'#8#8'TabOrder'
+'Repaint'#8#8'TabOrder'#2#0#7'TabStop'#9#0#7'TButton'#10'btnCancel1'#4'Left' +#2#0#7'TabStop'#9#0#7'TButton'#10'btnCancel1'#4'Left'#3'`'#1#6'Height'#2#25#3
+#3'`'#1#6'Height'#2#25#3'Top'#2#8#5'Width'#2'['#7'Anchors'#11#5'akTop'#7'akR' +'Top'#2#8#5'Width'#2'['#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing'
+'ight'#0#25'BorderSpacing.InnerBorder'#2#4#6'Cancel'#9#7'Caption'#6#6'Cancel' +'.InnerBorder'#2#4#6'Cancel'#9#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8
+#11'ModalResult'#2#2#8'TabOrder'#2#0#0#0#7'TButton'#5'btnOk'#4'Left'#3#255#0 +'TabOrder'#2#0#0#0#7'TButton'#5'btnOk'#4'Left'#3#255#0#6'Height'#2#25#3'Top'
+#6'Height'#2#25#3'Top'#2#8#5'Width'#2'['#7'Anchors'#11#5'akTop'#7'akRight'#0 +#2#8#5'Width'#2'['#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.Inne'
+#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#2'Ok'#7'Default'#9#11'ModalR' +'rBorder'#2#4#7'Caption'#6#2'Ok'#7'Default'#9#11'ModalResult'#2#1#8'TabOrder'
+'esult'#2#1#8'TabOrder'#2#1#0#0#0#9'TNotebook'#15'PagesProperties'#6'Height' +#2#1#0#0#0#9'TNotebook'#15'PagesProperties'#4'Left'#2#0#6'Height'#3#167#1#3
+#3'x'#1#5'Width'#3#201#1#5'Align'#7#8'alClient'#9'PageIndex'#2#1#8'TabOrder' +'Top'#2#0#5'Width'#3#201#1#5'Align'#7#8'alClient'#9'PageIndex'#2#0#8'TabOrde'
+#2#1#0#5'TPage'#9'pgGeneral'#7'Caption'#6#7'General'#11'ClientWidth'#3#197#1 +'r'#2#1#0#5'TPage'#9'pgGeneral'#7'Caption'#6#7'General'#11'ClientWidth'#3#197
+#12'ClientHeight'#3'Y'#1#0#6'TLabel'#12'labPaperSize'#4'Left'#2#15#6'Height' +#1#12'ClientHeight'#3#138#1#0#6'TLabel'#12'labPaperSize'#4'Left'#2#15#6'Heig'
+#2#20#3'Top'#2#19#5'Width'#2'B'#7'Caption'#6#10'Paper size'#11'ParentColor'#8 +'ht'#2#16#3'Top'#2#19#5'Width'#2'?'#7'Caption'#6#10'Paper size'#11'ParentCol'
+#0#0#6'TLabel'#12'labPaperType'#4'Left'#2#15#6'Height'#2#20#3'Top'#2'7'#5'Wi' +'or'#8#0#0#6'TLabel'#12'labPaperType'#4'Left'#2#15#6'Height'#2#16#3'Top'#2'7'
+'dth'#2'E'#7'Caption'#6#10'Paper type'#11'ParentColor'#8#0#0#6'TLabel'#11'la' +#5'Width'#2'@'#7'Caption'#6#10'Paper type'#11'ParentColor'#8#0#0#6'TLabel'#11
+'bPaperSrc'#4'Left'#2#15#6'Height'#2#20#3'Top'#2'\'#5'Width'#2'T'#7'Caption' +'labPaperSrc'#4'Left'#2#15#6'Height'#2#16#3'Top'#2'\'#5'Width'#2'N'#7'Captio'
+#6#12'Paper source'#11'ParentColor'#8#0#0#9'TComboBox'#11'cbPaperSize'#4'Lef' +'n'#6#12'Paper source'#11'ParentColor'#8#0#0#6'TLabel'#13'labResolution'#4'L'
+'t'#3#131#0#6'Height'#2#25#3'Top'#2#11#5'Width'#3'5'#1#16'AutoCompleteText' +'eft'#2#15#6'Height'#2#16#3'Top'#2'}'#5'Width'#2'>'#7'Caption'#6#10'Resoluti'
+#11#22'cbactEndOfLineComplete'#20'cbactSearchAscending'#0#13'DropDownCount'#2 +'on'#11'ParentColor'#8#0#0#9'TComboBox'#11'cbPaperSize'#4'Left'#3#130#0#6'He'
+#10#9'MaxLength'#2#0#10'OnKeyPress'#7#19'cbPaperSizeKEYPRESS'#11'ParentCtl3D' +'ight'#2#27#3'Top'#2#9#5'Width'#3'6'#1#12'AutoComplete'#8#13'DropDownCount'#2
+#8#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#0#0#0#9'TComboBox'#11'cbPaper' +#10#10'ItemHeight'#2#0#9'ItemWidth'#2#0#10'OnKeyPress'#7#19'cbPaperSizeKEYPR'
+'Type'#4'Left'#3#131#0#6'Height'#2#25#3'Top'#2'/'#5'Width'#3'5'#1#16'AutoCom' +'ESS'#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#0#0#0#9'TComboBox'#11'cbPa'
+'pleteText'#11#22'cbactEndOfLineComplete'#20'cbactSearchAscending'#0#9'MaxLe' +'perType'#4'Left'#3#130#0#6'Height'#2#27#3'Top'#2'-'#5'Width'#3'6'#1#12'Auto'
+'ngth'#2#0#10'OnKeyPress'#7#19'cbPaperSizeKEYPRESS'#11'ParentCtl3D'#8#5'Styl' +'Complete'#8#10'ItemHeight'#2#0#9'ItemWidth'#2#0#10'OnKeyPress'#7#19'cbPaper'
+'e'#7#14'csDropDownList'#8'TabOrder'#2#1#0#0#9'TComboBox'#10'cbPaperSrc'#4'L' +'SizeKEYPRESS'#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#1#0#0#9'TComboBox'
+'eft'#3#131#0#6'Height'#2#25#3'Top'#2'Q'#5'Width'#3'5'#1#16'AutoCompleteText' +#10'cbPaperSrc'#4'Left'#3#130#0#6'Height'#2#27#3'Top'#2'Q'#5'Width'#3'6'#1#12
+#11#22'cbactEndOfLineComplete'#20'cbactSearchAscending'#0#9'MaxLength'#2#0#10 +'AutoComplete'#8#10'ItemHeight'#2#0#9'ItemWidth'#2#0#10'OnKeyPress'#7#19'cbP'
+'OnKeyPress'#7#19'cbPaperSizeKEYPRESS'#11'ParentCtl3D'#8#5'Style'#7#14'csDro' +'aperSizeKEYPRESS'#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#4#0#0#9'TGrou'
+'pDownList'#8'TabOrder'#2#4#0#0#9'TGroupBox'#13'gbOrientation'#4'Left'#2#14#6 +'pBox'#13'gbOrientation'#4'Left'#2#15#6'Height'#2'w'#3'Top'#3#169#0#5'Width'
+'Height'#2'w'#3'Top'#2'{'#5'Width'#3#233#0#7'Caption'#6#13' Orientation '#12 +#3#233#0#7'Caption'#6#13' Orientation '#12'ClientHeight'#2'f'#11'ClientWidth'
+'ClientHeight'#2'd'#11'ClientWidth'#3#229#0#11'ParentCtl3D'#8#8'TabOrder'#2#6 +#3#229#0#8'TabOrder'#2#6#0#6'TImage'#14'imgOrientation'#4'Left'#3#167#0#6'He'
+#0#6'TImage'#14'imgOrientation'#4'Left'#3#167#0#6'Height'#2'0'#3'Top'#2#25#5 +'ight'#2'0'#3'Top'#2#25#5'Width'#2'4'#0#0#12'TRadioButton'#10'rbPortrait'#4
+'Width'#2'4'#11'Transparent'#8#0#0#12'TRadioButton'#10'rbPortrait'#4'Left'#2 +'Left'#2#7#6'Height'#2#21#3'Top'#2#5#5'Width'#2'A'#11'AllowGrayed'#9#7'Capti'
+#7#6'Height'#2#22#3'Top'#2#5#5'Width'#2'G'#11'AllowGrayed'#9#7'Caption'#6#8 +'on'#6#8'Portrait'#7'Checked'#9#10'DragCursor'#7#9'crDefault'#7'OnClick'#7#15
+'Portrait'#7'Checked'#9#10'DragCursor'#7#9'crDefault'#7'OnClick'#7#15'rbPort' +'rbPortraitCLICK'#5'State'#7#9'cbChecked'#8'TabOrder'#2#0#0#0#12'TRadioButto'
+'raitCLICK'#5'State'#7#9'cbChecked'#8'TabOrder'#2#0#0#0#12'TRadioButton'#11 +'n'#11'rbLandscape'#4'Left'#2#7#6'Height'#2#21#3'Top'#2#29#5'Width'#2'V'#11
+'rbLandscape'#4'Left'#2#7#6'Height'#2#22#3'Top'#2#29#5'Width'#2']'#11'AllowG' +'AllowGrayed'#9#7'Caption'#6#9'Landscape'#10'DragCursor'#7#9'crDefault'#7'On'
+'rayed'#9#7'Caption'#6#9'Landscape'#10'DragCursor'#7#9'crDefault'#7'OnClick' +'Click'#7#15'rbPortraitCLICK'#8'TabOrder'#2#1#7'TabStop'#8#0#0#12'TRadioButt'
+#7#15'rbPortraitCLICK'#8'TabOrder'#2#1#0#0#12'TRadioButton'#15'rbrev_Landsca' +'on'#15'rbrev_Landscape'#4'Left'#2#7#6'Height'#2#21#3'Top'#2'5'#5'Width'#3
+'pe'#4'Left'#2#7#6'Height'#2#22#3'Top'#2'5'#5'Width'#3#143#0#11'AllowGrayed' +#132#0#11'AllowGrayed'#9#7'Caption'#6#17'Reverse landscape'#10'DragCursor'#7
+#9#7'Caption'#6#17'Reverse landscape'#10'DragCursor'#7#9'crDefault'#7'OnClic' +#9'crDefault'#7'OnClick'#7#15'rbPortraitCLICK'#8'TabOrder'#2#2#7'TabStop'#8#0
+'k'#7#15'rbPortraitCLICK'#8'TabOrder'#2#2#0#0#12'TRadioButton'#14'rbrev_port' +#0#12'TRadioButton'#14'rbrev_portrait'#4'Left'#2#7#6'Height'#2#21#3'Top'#2'M'
+'rait'#4'Left'#2#7#6'Height'#2#22#3'Top'#2'M'#5'Width'#2'}'#11'AllowGrayed'#9 +#5'Width'#2'q'#11'AllowGrayed'#9#7'Caption'#6#16'Reverse portrait'#10'DragCu'
+#7'Caption'#6#16'Reverse portrait'#10'DragCursor'#7#9'crDefault'#7'OnClick'#7 +'rsor'#7#9'crDefault'#7'OnClick'#7#15'rbPortraitCLICK'#8'TabOrder'#2#3#7'Tab'
+#15'rbPortraitCLICK'#8'TabOrder'#2#3#0#0#0#9'TGroupBox'#8'gbDuplex'#4'Left'#3 +'Stop'#8#0#0#0#9'TGroupBox'#8'gbDuplex'#4'Left'#3#0#1#6'Height'#2'w'#3'Top'#3
+#255#0#6'Height'#2'w'#3'Top'#2'{'#5'Width'#3#185#0#7'Caption'#6#17' Duplex p' +#169#0#5'Width'#3#185#0#7'Caption'#6#17' Duplex printing '#12'ClientHeight'#2
+'rinting '#12'ClientHeight'#2'd'#11'ClientWidth'#3#181#0#11'ParentCtl3D'#8#8 +'f'#11'ClientWidth'#3#181#0#8'TabOrder'#2#2#0#6'TImage'#9'imgDuplex'#4'Left'
+'TabOrder'#2#2#0#6'TImage'#9'imgDuplex'#4'Left'#2'~'#6'Height'#2'4'#3'Top'#2 +#2'~'#6'Height'#2'4'#3'Top'#2#21#5'Width'#2','#0#0#12'TRadioButton'#12'rbDup'
+#21#5'Width'#2','#11'Transparent'#8#0#0#12'TRadioButton'#12'rbDuplexNone'#4 +'lexNone'#4'Left'#2#14#6'Height'#2#21#3'Top'#2#5#5'Width'#2'5'#11'AllowGraye'
+'Left'#2#14#6'Height'#2#22#3'Top'#2#5#5'Width'#2':'#11'AllowGrayed'#9#7'Capt' +'d'#9#7'Caption'#6#4'None'#7'Checked'#9#10'DragCursor'#7#9'crDefault'#7'OnCl'
+'ion'#6#4'None'#7'Checked'#9#10'DragCursor'#7#9'crDefault'#7'OnClick'#7#15'r' +'ick'#7#15'rbPortraitCLICK'#5'State'#7#9'cbChecked'#8'TabOrder'#2#0#0#0#12'T'
+'bPortraitCLICK'#5'State'#7#9'cbChecked'#8'TabOrder'#2#0#0#0#12'TRadioButton' +'RadioButton'#12'rbDuplexLong'#4'Left'#2#14#6'Height'#2#21#3'Top'#2#29#5'Wid'
+#12'rbDuplexLong'#4'Left'#2#14#6'Height'#2#22#3'Top'#2#29#5'Width'#2'['#11'A' +'th'#2'S'#11'AllowGrayed'#9#7'Caption'#6#9'Long edge'#10'DragCursor'#7#9'crD'
+'llowGrayed'#9#7'Caption'#6#9'Long edge'#10'DragCursor'#7#9'crDefault'#7'OnC' +'efault'#7'OnClick'#7#15'rbPortraitCLICK'#8'TabOrder'#2#1#7'TabStop'#8#0#0#12
+'lick'#7#15'rbPortraitCLICK'#8'TabOrder'#2#1#0#0#12'TRadioButton'#13'rbDuple' +'TRadioButton'#13'rbDuplexShort'#4'Left'#2#14#6'Height'#2#21#3'Top'#2'5'#5'W'
+'xShort'#4'Left'#2#14#6'Height'#2#22#3'Top'#2'5'#5'Width'#2'_'#11'AllowGraye' +'idth'#2'V'#11'AllowGrayed'#9#7'Caption'#6#10'Short edge'#10'DragCursor'#7#9
+'d'#9#7'Caption'#6#10'Short edge'#10'DragCursor'#7#9'crDefault'#7'OnClick'#7 +'crDefault'#7'OnClick'#7#15'rbPortraitCLICK'#8'TabOrder'#2#2#7'TabStop'#8#0#0
+#15'rbPortraitCLICK'#8'TabOrder'#2#2#0#0#0#9'TGroupBox'#9'gbBanners'#4'Left' +#0#9'TGroupBox'#9'gbBanners'#4'Left'#2#16#6'Height'#2'`'#3'Top'#3'%'#1#5'Wid'
,#2#15#6'Height'#2'`'#3'Top'#3#247#0#5'Width'#3#232#0#7'Caption'#6#9' Banners' ,'th'#3#232#0#7'Caption'#6#9' Banners '#12'ClientHeight'#2'O'#11'ClientWidth'
+' '#12'ClientHeight'#2'M'#11'ClientWidth'#3#228#0#11'ParentCtl3D'#8#8'TabOrd' +#3#228#0#8'TabOrder'#2#3#0#6'TLabel'#11'labBanStart'#4'Left'#2#6#6'Height'#2
+'er'#2#3#0#6'TLabel'#11'labBanStart'#4'Left'#2#6#6'Height'#2#13#3'Top'#2#9#5 +#16#3'Top'#2#9#5'Width'#2#29#7'Caption'#6#5'Start'#11'ParentColor'#8#0#0#6'T'
+'Width'#2#26#7'Caption'#6#5'Start'#11'ParentColor'#8#0#0#6'TLabel'#9'labBanE' +'Label'#9'labBanEnd'#4'Left'#2#6#6'Height'#2#16#3'Top'#2'1'#5'Width'#2#24#7
+'nd'#4'Left'#2#6#6'Height'#2#13#3'Top'#2'1'#5'Width'#2#23#7'Caption'#6#3'End' +'Caption'#6#3'End'#11'ParentColor'#8#0#0#9'TComboBox'#10'cbBanStart'#4'Left'
+#11'ParentColor'#8#0#0#9'TComboBox'#10'cbBanStart'#4'Left'#2'^'#6'Height'#2 +#2'^'#6'Height'#2#27#3'Top'#2#1#5'Width'#3#128#0#12'AutoComplete'#8#10'ItemH'
+#25#3'Top'#2#1#5'Width'#3#128#0#16'AutoCompleteText'#11#22'cbactEndOfLineCom' +'eight'#2#0#9'ItemWidth'#2#0#10'OnKeyPress'#7#19'cbPaperSizeKEYPRESS'#5'Styl'
+'plete'#20'cbactSearchAscending'#0#9'MaxLength'#2#0#10'OnKeyPress'#7#19'cbPa' +'e'#7#14'csDropDownList'#8'TabOrder'#2#0#0#0#9'TComboBox'#8'cbBanEnd'#4'Left'
+'perSizeKEYPRESS'#11'ParentCtl3D'#8#5'Style'#7#14'csDropDownList'#8'TabOrder' +#2'^'#6'Height'#2#27#3'Top'#2')'#5'Width'#3#128#0#12'AutoComplete'#8#10'Item'
+#2#0#0#0#9'TComboBox'#8'cbBanEnd'#4'Left'#2'^'#6'Height'#2#25#3'Top'#2')'#5 +'Height'#2#0#9'ItemWidth'#2#0#10'OnKeyPress'#7#19'cbPaperSizeKEYPRESS'#5'Sty'
+'Width'#3#128#0#16'AutoCompleteText'#11#22'cbactEndOfLineComplete'#20'cbactS' +'le'#7#14'csDropDownList'#8'TabOrder'#2#1#0#0#0#9'TGroupBox'#12'gbPagesSheet'
+'earchAscending'#0#9'MaxLength'#2#0#10'OnKeyPress'#7#19'cbPaperSizeKEYPRESS' +#4'Left'#3#0#1#6'Height'#2'`'#3'Top'#3'%'#1#5'Width'#3#185#0#7'Caption'#6#17
+#11'ParentCtl3D'#8#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#1#0#0#0#9'TGr' +' Pages per sheet '#12'ClientHeight'#2'O'#11'ClientWidth'#3#181#0#8'TabOrder'
+'oupBox'#12'gbPagesSheet'#4'Left'#3#255#0#6'Height'#2'`'#3'Top'#3#247#0#5'Wi' +#2#5#0#6'TImage'#12'imgPageSheet'#4'Left'#2'N'#6'Height'#2'2'#3'Top'#2#17#5
+'dth'#3#185#0#7'Caption'#6#17' Pages per sheet '#12'ClientHeight'#2'M'#11'Cl' +'Width'#2'P'#0#0#12'TRadioButton'#8'rbSheet1'#4'Left'#2#6#6'Height'#2#21#3'T'
+'ientWidth'#3#181#0#11'ParentCtl3D'#8#8'TabOrder'#2#5#0#6'TImage'#12'imgPage' +'op'#2#5#5'Width'#2#30#11'AllowGrayed'#9#7'Caption'#6#1'1'#7'Checked'#9#10'D'
+'Sheet'#4'Left'#2'N'#6'Height'#2'2'#3'Top'#2#17#5'Width'#2'P'#11'Transparent' +'ragCursor'#7#9'crDefault'#7'OnClick'#7#15'rbPortraitCLICK'#5'State'#7#9'cbC'
+#8#0#0#12'TRadioButton'#8'rbSheet1'#4'Left'#2#6#6'Height'#2#22#3'Top'#2#5#5 +'hecked'#8'TabOrder'#2#0#0#0#12'TRadioButton'#8'rbSheet2'#4'Left'#2#6#6'Heig'
+'Width'#2' '#11'AllowGrayed'#9#7'Caption'#6#1'1'#7'Checked'#9#10'DragCursor' +'ht'#2#21#3'Top'#2#25#5'Width'#2#30#11'AllowGrayed'#9#7'Caption'#6#1'2'#10'D'
+#7#9'crDefault'#7'OnClick'#7#15'rbPortraitCLICK'#5'State'#7#9'cbChecked'#8'T' +'ragCursor'#7#9'crDefault'#7'OnClick'#7#15'rbPortraitCLICK'#8'TabOrder'#2#1#7
+'abOrder'#2#0#0#0#12'TRadioButton'#8'rbSheet2'#4'Left'#2#6#6'Height'#2#22#3 +'TabStop'#8#0#0#12'TRadioButton'#8'rbSheet4'#4'Left'#2#6#6'Height'#2#21#3'To'
+'Top'#2#25#5'Width'#2' '#11'AllowGrayed'#9#7'Caption'#6#1'2'#10'DragCursor'#7 +'p'#2'.'#5'Width'#2#30#11'AllowGrayed'#9#7'Caption'#6#1'4'#10'DragCursor'#7#9
+#9'crDefault'#7'OnClick'#7#15'rbPortraitCLICK'#8'TabOrder'#2#1#0#0#12'TRadio' +'crDefault'#7'OnClick'#7#15'rbPortraitCLICK'#8'TabOrder'#2#2#7'TabStop'#8#0#0
+'Button'#8'rbSheet4'#4'Left'#2#6#6'Height'#2#22#3'Top'#2'.'#5'Width'#2' '#11 +#0#9'TComboBox'#12'cbResolution'#4'Left'#3#130#0#6'Height'#2#27#3'Top'#2'u'#5
+'AllowGrayed'#9#7'Caption'#6#1'4'#10'DragCursor'#7#9'crDefault'#7'OnClick'#7 +'Width'#3'6'#1#12'AutoComplete'#8#10'ItemHeight'#2#0#9'ItemWidth'#2#0#10'OnK'
+#15'rbPortraitCLICK'#8'TabOrder'#2#2#0#0#0#0#5'TPage'#7'pgMarge'#7'Caption'#6 +'eyPress'#7#19'cbPaperSizeKEYPRESS'#5'Style'#7#14'csDropDownList'#8'TabOrder'
+#7'Borders'#0#0#0#0 +#2#7#0#0#0#5'TPage'#7'pgMarge'#7'Caption'#6#7'Borders'#0#0#0#0
]); ]);

View File

@ -45,6 +45,7 @@ type
btnCancel1: TBUTTON; btnCancel1: TBUTTON;
btnOk: TBUTTON; btnOk: TBUTTON;
cbPaperSize: TCOMBOBOX; cbPaperSize: TCOMBOBOX;
cbResolution: TComboBox;
cbPaperType: TCOMBOBOX; cbPaperType: TCOMBOBOX;
cbPaperSrc: TCOMBOBOX; cbPaperSrc: TCOMBOBOX;
cbBanStart: TCOMBOBOX; cbBanStart: TCOMBOBOX;
@ -59,6 +60,7 @@ type
labBanStart: TLABEL; labBanStart: TLABEL;
labBanEnd: TLABEL; labBanEnd: TLABEL;
labPaperSrc: TLABEL; labPaperSrc: TLABEL;
labResolution: TLabel;
labPaperType: TLABEL; labPaperType: TLABEL;
labPaperSize: TLABEL; labPaperSize: TLABEL;
PagesProperties: TNOTEBOOK; PagesProperties: TNOTEBOOK;
@ -82,7 +84,8 @@ type
procedure dlgpropertiesprinterSHOW(Sender: TObject); procedure dlgpropertiesprinterSHOW(Sender: TObject);
private private
{ private declarations } { private declarations }
fPaperSizeOptions,FMediaTypeOptions,FInputSlotOptions: TStringList; fPaperSizeOptions,FMediaTypeOptions,FInputSlotOptions,
FResolutions: TStringList;
procedure RefreshInfos; procedure RefreshInfos;
@ -131,7 +134,7 @@ end;
//Initialization //Initialization
procedure Tdlgpropertiesprinter.dlgpropertiesprinterCREATE(Sender: TObject); procedure Tdlgpropertiesprinter.dlgpropertiesprinterCREATE(Sender: TObject);
Var Lst : TStringList; Var Lst : TStringList;
i : Integer; i,j : Integer;
pOr : TPrinterOrientation; pOr : TPrinterOrientation;
St : String; St : String;
begin begin
@ -142,10 +145,13 @@ begin
FPaperSizeOptions := TStringList.Create; FPaperSizeOptions := TStringList.Create;
FMediaTypeOptions := TStringlist.Create; FMediaTypeOptions := TStringlist.Create;
FInputSlotOptions := TStringList.Create; FInputSlotOptions := TStringList.Create;
FResolutions := TStringList.Create;
InitCombo(cbPaperSize,'PageSize',Printer.PaperSize.PaperName, FPaperSizeOptions); InitCombo(cbPaperSize,'PageSize',Printer.PaperSize.PaperName, FPaperSizeOptions);
InitCombo(cbPaperType,'MediaType','Plain Paper',FMediaTypeOptions); InitCombo(cbPaperType,'MediaType','Plain Paper',FMediaTypeOptions);
InitCombo(cbPaperSrc ,'InputSlot','Auto Sheet Feeder',FInputSlotOptions); InitCombo(cbPaperSrc ,'InputSlot','Auto Sheet Feeder',FInputSlotOptions);
st := THackCUPSPrinter(Printer).GetResolutionOption;
InitCombo(cbResolution,'Resolution', st, FResolutions);
Lst:=TStringList.Create; Lst:=TStringList.Create;
try try
@ -218,6 +224,7 @@ end;
procedure Tdlgpropertiesprinter.FormDestroy(Sender: TObject); procedure Tdlgpropertiesprinter.FormDestroy(Sender: TObject);
begin begin
if Sender=nil then ; if Sender=nil then ;
FResolutions.Free;
FPaperSizeOptions.Free; FPaperSizeOptions.Free;
FMediaTypeOptions.Free; FMediaTypeOptions.Free;
FInputSlotOptions.Free; FInputSlotOptions.Free;
@ -277,6 +284,11 @@ begin
THackCUPSPrinter(Printer).FreeOptions; THackCUPSPrinter(Printer).FreeOptions;
THackCUPSPrinter(Printer).SetOptionsOfPrinter; THackCUPSPrinter(Printer).SetOptionsOfPrinter;
//Resolution
if (cbResolution.Items.Count>0) and (cbResolution.ItemIndex<>cbResolution.Tag) then
THackCUPSPrinter(Printer).cupsAddOption('Resolution',
fResolutions[cbResolution.ItemIndex]);
//PageSize //PageSize
if (cbPaperSize.Items.Count>0) and (cbPaperSize.ItemIndex<>cbPaperSize.Tag) then if (cbPaperSize.Items.Count>0) and (cbPaperSize.ItemIndex<>cbPaperSize.Tag) then
begin begin
@ -294,7 +306,6 @@ begin
if (cbPaperSrc.Items.Count>0) and (cbPaperSrc.ItemIndex<>cbPaperSrc.Tag) then if (cbPaperSrc.Items.Count>0) and (cbPaperSrc.ItemIndex<>cbPaperSrc.Tag) then
THackCUPSPrinter(Printer).cupsAddOption('InputSlot', THackCUPSPrinter(Printer).cupsAddOption('InputSlot',
FInputSlotOptions[cbPaperSrc.ItemIndex]); FInputSlotOptions[cbPaperSrc.ItemIndex]);
//Duplex //Duplex
if gbDuplex.Enabled then if gbDuplex.Enabled then