Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kam-printing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wizards
kam-printing
Commits
70c7b2d8
Commit
70c7b2d8
authored
13 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
PPD: More bits...
parent
f1dd212e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ppd/PPD.pm
+27
-15
27 additions, 15 deletions
ppd/PPD.pm
ppd/PPD/PJL.pm
+11
-0
11 additions, 0 deletions
ppd/PPD/PJL.pm
ppd/gen-hp
+52
-1
52 additions, 1 deletion
ppd/gen-hp
with
90 additions
and
16 deletions
ppd/PPD.pm
+
27
−
15
View file @
70c7b2d8
...
@@ -82,6 +82,12 @@ set('d/ColorDevice:b', 0);
...
@@ -82,6 +82,12 @@ set('d/ColorDevice:b', 0);
set
('
d/DefaultColorSpace:q
',
'
Gray
');
set
('
d/DefaultColorSpace:q
',
'
Gray
');
set
('
d/FileSystem:b
',
0
);
set
('
d/FileSystem:b
',
0
);
# Section "c": CUPS options
# (none by default)
# Section "j": JCL options
# (none by default)
my
@ui_groups
=
();
my
@ui_groups
=
();
sub
ui_group
($)
{
sub
ui_group
($)
{
...
@@ -102,7 +108,7 @@ $options{'n'} = { Key => '', Options => [] };
...
@@ -102,7 +108,7 @@ $options{'n'} = { Key => '', Options => [] };
# option({
# option({
# Key => key, # (mandatory)
# Key => key, # (mandatory)
# Name => name, # descriptive name (default: same as Key)
# Name => name, # descriptive name (default: same as Key)
# Type => type, # PickOne / PickMany / Boolean
# Type => type, # PickOne
(default)
/ PickMany / Boolean
# UI => group, # UI group ('' if outside groups, default: non-UI option)
# UI => group, # UI group ('' if outside groups, default: non-UI option)
# JCL => 1, # if this is a JCL option
# JCL => 1, # if this is a JCL option
# Section => sec, # OrderDependency section: ExitServer / Prolog / DocumentSetup /
# Section => sec, # OrderDependency section: ExitServer / Prolog / DocumentSetup /
...
@@ -137,9 +143,11 @@ sub heading($) {
...
@@ -137,9 +143,11 @@ sub heading($) {
print
"
\n
";
print
"
\n
";
}
}
sub
emit
($)
{
sub
emit
($
;$
) {
my
(
$section
)
=
@_
;
my
(
$section
,
$heading
)
=
@_
;
my
$opts
=
$options
{
$section
};
my
$opts
=
$options
{
$section
};
$opts
or
return
;
heading
(
$heading
)
if
defined
$heading
;
for
my
$k
(
sort
keys
%$opts
)
{
for
my
$k
(
sort
keys
%$opts
)
{
my
$v
=
$opts
->
{
$k
};
my
$v
=
$opts
->
{
$k
};
if
(
!
$v
)
{
if
(
!
$v
)
{
...
@@ -161,14 +169,19 @@ sub get_default($) {
...
@@ -161,14 +169,19 @@ sub get_default($) {
sub
emit_option
($)
{
sub
emit_option
($)
{
my
(
$o
)
=
@_
;
my
(
$o
)
=
@_
;
my
$key
=
$o
->
{
Key
};
my
$key
=
$o
->
{
Key
};
my
$type
=
$o
->
{
Type
}
//
'
PickOne
';
print
"
%* ===
$key
===
\n
";
my
$jcl
=
(
$o
->
{
JCL
}
//
(
$key
=~
/^JCL/
))
?
"
JCL
"
:
"";
my
$jcl
=
(
$o
->
{
JCL
}
//
(
$key
=~
/^JCL/
))
?
"
JCL
"
:
"";
if
(
defined
$o
->
{
UI
})
{
print
"
*
${jcl}
OpenUI *
$key
/
",
(
$o
->
{
Name
}
//
$o
->
{
Key
}),
'
:
',
$o
->
{
Type
},
"
\n
";
}
if
(
defined
$o
->
{
UI
})
{
print
"
*
${jcl}
OpenUI *
$key
/
",
(
$o
->
{
Name
}
//
$o
->
{
Key
}),
"
:
$type
\n
";
}
my
$pri
=
$o
->
{
Priority
}
//
100
;
my
$pri
=
$o
->
{
Priority
}
//
100
;
my
$sec
=
$o
->
{
Section
}
//
(
$jcl
?
"
JCLSetup
"
:
"
AnySetup
");
my
$sec
=
$o
->
{
Section
}
//
(
$jcl
?
"
JCLSetup
"
:
"
AnySetup
");
print
'
*
',
((
defined
$o
->
{
UI
})
?
""
:
'
NonUI
'),
"
OrderDependency
$pri
$sec
*
$key
\n
";
print
'
*
',
((
defined
$o
->
{
UI
})
?
""
:
'
NonUI
'),
"
OrderDependency
$pri
$sec
*
$key
\n
";
print
"
*Default
$key
:
",
get_default
(
$o
),
"
\n
";
print
"
*Default
$key
:
",
get_default
(
$o
),
"
\n
";
for
my
$v
(
@
{
$o
->
{
Values
}})
{
for
my
$v
(
@
{
$o
->
{
Values
}})
{
print
"
*
$key
",
$v
->
{
Key
},
'
/
',
(
$v
->
{
Name
}
//
$v
->
{
Key
}),
'
:
',
format_value
('
i
',
$v
->
{
PS
}),
"
\n
";
my
$ps
=
$v
->
{
PS
};
# $ps = "\n$ps" unless $ps =~ /^\n/s;
# $ps = "$ps\n" unless $ps =~ /\n$/s;
print
"
*
$key
",
$v
->
{
Key
},
'
/
',
(
$v
->
{
Name
}
//
$v
->
{
Key
}),
'
:
',
format_value
('
i
',
$ps
),
"
\n
";
}
}
if
(
defined
$o
->
{
UI
})
{
print
"
*
${jcl}
CloseUI *
$key
\n
";
}
if
(
defined
$o
->
{
UI
})
{
print
"
*
${jcl}
CloseUI *
$key
\n
";
}
print
"
\n
";
print
"
\n
";
...
@@ -202,14 +215,11 @@ sub generate() {
...
@@ -202,14 +215,11 @@ sub generate() {
print
"
*% PPD file generated by UCW PPD generator
\n
";
print
"
*% PPD file generated by UCW PPD generator
\n
";
fill_missing
();
fill_missing
();
heading
("
File version
");
emit
('
f
',
'
File version
');
emit
('
f
');
emit
('
p
',
'
Product information
');
emit
('
d
',
'
Device capabilities
');
heading
("
Product information
");
emit
('
c
',
'
CUPS options
');
emit
('
p
');
emit
('
j
',
'
JCL setup
');
heading
("
Device capabilities
");
emit
('
d
');
for
my
$g
(
@ui_groups
)
{
for
my
$g
(
@ui_groups
)
{
next
if
$g
->
{
Key
}
eq
'';
next
if
$g
->
{
Key
}
eq
'';
...
@@ -220,8 +230,10 @@ sub generate() {
...
@@ -220,8 +230,10 @@ sub generate() {
heading
("
General UI options
");
heading
("
General UI options
");
emit_group
(
$ui_groups
[
0
]);
emit_group
(
$ui_groups
[
0
]);
if
(
@
{
$options
{'
n
'}
->
{
Options
}})
{
heading
("
Non-UI options
");
heading
("
Non-UI options
");
emit_group
(
$options
{'
n
'});
emit_group
(
$options
{'
n
'});
}
}
}
42
;
42
;
This diff is collapsed.
Click to expand it.
ppd/PPD/PJL.pm
0 → 100644
+
11
−
0
View file @
70c7b2d8
package
PPD::
PJL
;
use
PPD
;
sub
add_jcl
()
{
set
('
j/JCLBegin
',
'
<1B>%-12345X@PJL<0A>
');
set
('
j/JCLToPSInterpreter
',
'
@PJL ENTER LANGUAGE = POSTSCRIPT<0A>
');
set
('
j/JCLEnd
',
'
<1B>%-12345X@PJL EOJ<0A><1B>%-12345X<0A>
');
}
42
;
This diff is collapsed.
Click to expand it.
ppd/gen-hp
+
52
−
1
View file @
70c7b2d8
...
@@ -5,6 +5,7 @@ use warnings;
...
@@ -5,6 +5,7 @@ use warnings;
use
lib
"
.
";
use
lib
"
.
";
use
PPD
;
use
PPD
;
use
PPD::
PJL
;
set
('
f/FileVersion
',
'
1.0
');
set
('
f/FileVersion
',
'
1.0
');
set
('
f/PCFileName
',
'
HP4350.PPD
');
set
('
f/PCFileName
',
'
HP4350.PPD
');
...
@@ -18,10 +19,11 @@ set('d/TTRasterizer:s', 'Type42');
...
@@ -18,10 +19,11 @@ set('d/TTRasterizer:s', 'Type42');
set
('
d/VariablePaperSize:b
',
1
);
set
('
d/VariablePaperSize:b
',
1
);
set
('
d/Protocols:s
',
'
PJL TBCP
');
set
('
d/Protocols:s
',
'
PJL TBCP
');
set
('
c/cupsProtocol:s
',
'
None
');
option
({
option
({
Key
=>
'
Duplex
',
Key
=>
'
Duplex
',
Name
=>
'
2-Sided Printing
',
Name
=>
'
2-Sided Printing
',
Type
=>
'
PickOne
',
UI
=>
'',
UI
=>
'',
Values
=>
[
Values
=>
[
{
Key
=>
'
None
',
Name
=>
'
Off (1-Sided)
',
PS
=>
"
<< /Duplex false >> setpagedevice
"
},
{
Key
=>
'
None
',
Name
=>
'
Off (1-Sided)
',
PS
=>
"
<< /Duplex false >> setpagedevice
"
},
...
@@ -30,4 +32,53 @@ option({
...
@@ -30,4 +32,53 @@ option({
]
]
});
});
option
({
Key
=>
'
Resolution
',
Name
=>
'
Printer Resolution
',
UI
=>
'',
Priority
=>
5
,
Section
=>
'
DocumentSetup
',
Values
=>
[
{
Key
=>
'
1200x1200dpi
',
Name
=>
'
ProRes 1200
',
PS
=>
'
<< /HWResolution [1200 1200] /PreRenderingEnhance false >> setpagedevice
'
},
{
Key
=>
'
600x600x2dpi
',
Name
=>
'
FastRes 1200
',
PS
=>
'
<< /HWResolution [1200 1200] /PreRenderingEnhance true >> setpagedevice
',
Default
=>
1
},
{
Key
=>
'
600x600dpi
',
Name
=>
'
600 DPI
',
PS
=>
'
<< /HWResolution [600 600] /PreRenderingEnhance false >> setpagedevice
'
},
]
});
option
({
Key
=>
'
HPEconoMode
',
Name
=>
'
EconoMode
',
Type
=>
'
Boolean
',
UI
=>
'',
Values
=>
[
{
Key
=>
'
False
',
Name
=>
'
Highest Quality
',
PS
=>
'
<< /EconoMode false >> setpagedevice
',
Default
=>
1
},
{
Key
=>
'
True
',
Name
=>
'
Save Toner
',
PS
=>
'
<< /EconoMode true >> setpagedevice
'
},
]
});
option
({
Key
=>
'
Smoothing
',
Name
=>
'
Resolution Enhancement
',
Type
=>
'
Boolean
',
UI
=>
'',
Priority
=>
20
,
Section
=>
'
DocumentSetup
',
Values
=>
[
{
Key
=>
'
False
',
Name
=>
'
Off
',
PS
=>
'
<< /PostRenderingEnhance true /PostRenderingEnhanceDetails << /REValue 0 /Type 8 >> >> setpagedevice
'
},
{
Key
=>
'
True
',
Name
=>
'
On
',
PS
=>
'
<< /PostRenderingEnhance true /PostRenderingEnhanceDetails << /REValue 2 /Type 8 >> >> setpagedevice
',
Default
=>
1
},
]
});
option
({
Key
=>
'
Collate
',
Type
=>
'
Boolean
',
UI
=>
'',
Values
=>
[
{
Key
=>
'
False
',
Name
=>
'
Off
',
PS
=>
'
<< /Collate false >> setpagedevice
'
},
{
Key
=>
'
True
',
Name
=>
'
On
',
PS
=>
'
<< /Collate true >> setpagedevice
',
Default
=>
1
},
]
});
PPD::PJL::
add_jcl
();
generate
();
generate
();
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment