Skip to content
Snippets Groups Projects
Commit f1bd91bb authored by Martin Mareš's avatar Martin Mareš
Browse files

PPD: Custom page sizes work

parent 9798e614
Branches
No related tags found
No related merge requests found
...@@ -369,7 +369,7 @@ sub emit_option($) { ...@@ -369,7 +369,7 @@ sub emit_option($) {
my $i = 0; my $i = 0;
for my $p (@{$c->{Params}}) { for my $p (@{$c->{Params}}) {
$i++; $i++;
print "*Param$key ", $p->{Key}; print "*ParamCustom$key ", $p->{Key};
print '/', $p->{Name} if defined($p->{Name}) && $p->{Name} ne $p->{Key}; print '/', $p->{Name} if defined($p->{Name}) && $p->{Name} ne $p->{Key};
printf ": %d %s %d %d\n", $i, $p->{Unit}, $p->{Min}, $p->{Max}; printf ": %d %s %d %d\n", $i, $p->{Unit}, $p->{Min}, $p->{Max};
} }
......
...@@ -50,6 +50,7 @@ my %media = ( ...@@ -50,6 +50,7 @@ my %media = (
# JCL => 1, # Paper should be handled via JCL (default: 0) # JCL => 1, # Paper should be handled via JCL (default: 0)
# PSPageSize => PS, # PS code for setting PageSize (subroutine called with ref to media object) # PSPageSize => PS, # PS code for setting PageSize (subroutine called with ref to media object)
# PSPageRegion => PS, # The same for PageRegion (default: use PSPageSize) # PSPageRegion => PS, # The same for PageRegion (default: use PSPageSize)
# PSCustomPageSize => PS, # PS code for setting custom PageSize (default: use setpagedevice)
# }) # })
sub add_papers($) { sub add_papers($) {
# Scan available paper formats # Scan available paper formats
...@@ -89,7 +90,7 @@ sub add_papers($) { ...@@ -89,7 +90,7 @@ sub add_papers($) {
} sort keys %real_media ], } sort keys %real_media ],
Default => $o->{DefPaper}, Default => $o->{DefPaper},
Custom => { Custom => {
PS => 'pop pop pop << /PageSize [5 -2 roll] >> setpagedevice', PS => $o->{PSCustomPageSize} // 'pop pop pop << /PageSize [5 -2 roll] >> setpagedevice',
Params => [ Params => [
{ Key => 'Width', Unit => 'points', Min => $minw, Max => $maxw }, { Key => 'Width', Unit => 'points', Min => $minw, Max => $maxw },
{ Key => 'Height', Unit => 'points', Min => $minh, Max => $maxh }, { Key => 'Height', Unit => 'points', Min => $minh, Max => $maxh },
......
#!/usr/bin/perl #!/usr/bin/perl
# FIXME: Custom paper sizes
# FIXME: Precision of paper sizes (and mismatch with paperconf) # FIXME: Precision of paper sizes (and mismatch with paperconf)
# FIXME: Paper orientation
# FIXME: Color adjustments # FIXME: Color adjustments
# FIXME: cupsIPPFinishings
# FIXME: cupsSingleFile?
use strict; use strict;
use warnings; use warnings;
...@@ -75,7 +75,7 @@ option({ ...@@ -75,7 +75,7 @@ option({
JCL => 1, JCL => 1,
Values => [ Values => [
{ Key => 'False', Name => 'Print normally', PS => jopt('PRIVATE', "") }, { Key => 'False', Name => 'Print normally', PS => jopt('PRIVATE', "") },
{ Key => 'True', Name => 'Private print-out (wait for the user to log in)', PS => jopt('PRIVATE', 'YES') }, { Key => 'True', Name => 'Private print-out', PS => jopt('PRIVATE', 'YES') },
], ],
}); });
...@@ -87,8 +87,9 @@ PPD::Paper::add_papers({ ...@@ -87,8 +87,9 @@ PPD::Paper::add_papers({
MarginH => 11.34, MarginV => 11.34, # FIXME: show as floats MarginH => 11.34, MarginV => 11.34, # FIXME: show as floats
JCL => 1, JCL => 1,
PSPageSize => sub { my ($m) = @_; return jopt('MEDIAXSIZE', $m->{W}, 'MEDIAYSIZE', $m->{H}); }, PSPageSize => sub { my ($m) = @_; return jopt('MEDIAXSIZE', $m->{W}, 'MEDIAYSIZE', $m->{H}); },
# FIXME: LeadingEdge PSCustomPageSize => jopt('MEDIAXSIZE', '\1', 'MEDIAYSIZE', '\2'),
}); });
switch_group('Media'); switch_group('Media');
option({ option({
...@@ -270,6 +271,8 @@ option({ ...@@ -270,6 +271,8 @@ option({
], ],
}); });
# This is very similar to *LeadingEdge, but the semantics are subtly different,
# so we prefer to use a different name.
option({ option({
Key => 'XRFeed', Key => 'XRFeed',
Name => 'Feed Orientation', Name => 'Feed Orientation',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment