From: ivan Date: Wed, 25 Apr 2007 01:35:33 +0000 (+0000) Subject: add lpr-postscript_prefix and lpr-postscript_suffix config options for printer comman... X-Git-Tag: freeside_1_7_3rc1~465 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=3dd698c494cf2e681bea19617f429a81c0012f67;p=freeside.git add lpr-postscript_prefix and lpr-postscript_suffix config options for printer commands to place printer in postscript mode --- diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index f32b87a57..a3187be10 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -757,6 +757,20 @@ httemplate/docs/config.html 'type' => 'checkbox', }, + { + 'key' => 'lpr-postscript_prefix', + 'section' => 'billing', + 'description' => 'Raw printer commands prepended to the beginning of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)', + 'type' => 'text', + }, + + { + 'key' => 'lpr-postscript_suffix', + 'section' => 'billing', + 'description' => 'Raw printer commands added to the end of postscript print jobs (evaluated as a double-quoted perl string - backslash escapes are available)', + 'type' => 'text', + }, + { 'key' => 'money_char', 'section' => '', diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 7cf7eae43..91a0adc74 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2090,10 +2090,21 @@ sub print_ps { unlink("$file.dvi", "$file.log", "$file.aux", "$file.ps", "$file.tex"); my $ps = ''; + + if ( $conf->exists('lpr-postscript_prefix') ) { + my $prefix = $conf->config('lpr-postscript_prefix'); + $ps .= eval qq("$prefix"); + } + while () { $ps .= $_; } + if ( $conf->exists('lpr-postscript_suffix') ) { + my $suffix = $conf->config('lpr-postscript_suffix'); + $ps .= eval qq("$suffix"); + } + close POSTSCRIPT; return $ps;