Skip to content
Browse files

Correction to convert Printer Profile units to Postscript Points prio…

…r to making adjustments

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
  • Loading branch information...
1 parent aba8d91 commit ecdf350255f38a8f0d2c9d8ecc66ba0d38889378 Chris Nighswonger committed with Joshua Ferraro
Showing with 6 additions and 4 deletions.
  1. +6 −4 labels/label-print-pdf.pl
View
10 labels/label-print-pdf.pl
@@ -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'};
@@ -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'} ) {

0 comments on commit ecdf350

Please sign in to comment.
Something went wrong with that request. Please try again.