From ecdf350255f38a8f0d2c9d8ecc66ba0d38889378 Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Tue, 19 Feb 2008 11:26:06 +1300 Subject: [PATCH] Correction to convert Printer Profile units to Postscript Points prior to making adjustments Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- labels/label-print-pdf.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/labels/label-print-pdf.pl b/labels/label-print-pdf.pl index 79e01c9aa7..e2cfe2772b 100755 --- a/labels/label-print-pdf.pl +++ b/labels/label-print-pdf.pl @@ -63,8 +63,10 @@ my $units = 'POINTS' #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 ( $DEBUG ) { } 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'} ) { -- 2.11.4.GIT