Skip to content

Commit

Permalink
Correction to convert Printer Profile units to Postscript Points prio…
Browse files Browse the repository at this point in the history
…r to making adjustments

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
  • Loading branch information
cnighswonger authored and Joshua Ferraro committed Feb 19, 2008
1 parent aba8d91 commit ecdf350
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions labels/label-print-pdf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@
#warn Dumper $template;

my $unitvalue = GetUnitsValue($units);
my $prof_unitvalue = GetUnitsValue($profile->{'unit'});

warn "Template units: $units which converts to $unitvalue PostScript Points" if $DEBUG;
warn "Profile units: $profile->{'unit'} which converts to $prof_unitvalue PostScript Points" if $DEBUG;

my $tmpl_code = $template->{'tmpl_code'};
my $tmpl_desc = $template->{'tmpl_desc'};
Expand Down Expand Up @@ -138,10 +140,10 @@
}

if ( $profile->{'prof_id'} ) {
$top_margin = $top_margin + $profile->{'offset_vert'}; # controls vertical offset
$label_height = $label_height + $profile->{'creep_vert'}; # controls vertical creep
$left_margin = $left_margin + $profile->{'offset_horz'}; # controls horizontal offset
$label_width = $label_width + $profile->{'creep_horz'}; # controls horizontal creep
$top_margin = $top_margin + ($profile->{'offset_vert'} * $prof_unitvalue); # controls vertical offset
$label_height = $label_height + ($profile->{'creep_vert'} * $prof_unitvalue); # controls vertical creep
$left_margin = $left_margin + ($profile->{'offset_horz'} * $prof_unitvalue); # controls horizontal offset
$label_width = $label_width + ($profile->{'creep_horz'} * $prof_unitvalue); # controls horizontal creep
}

if ( $DEBUG && $profile->{'prof_id'} ) {
Expand Down

0 comments on commit ecdf350

Please sign in to comment.