diff options
author | ivan <ivan> | 2007-04-25 01:35:33 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-04-25 01:35:33 +0000 |
commit | 3dd698c494cf2e681bea19617f429a81c0012f67 (patch) | |
tree | a557cb0731032b1eba8647e4521265050d0cbd4c | |
parent | 73e3de28477eff6b4e2e4ce7f00af2268eb8b04c (diff) |
add lpr-postscript_prefix and lpr-postscript_suffix config options for printer commands to place printer in postscript mode
-rw-r--r-- | FS/FS/Conf.pm | 14 | ||||
-rw-r--r-- | FS/FS/cust_bill.pm | 11 |
2 files changed, 25 insertions, 0 deletions
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 @@ -758,6 +758,20 @@ httemplate/docs/config.html }, { + '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' => '', 'description' => 'Currency symbol - defaults to `$\'', 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 (<POSTSCRIPT>) { $ps .= $_; } + if ( $conf->exists('lpr-postscript_suffix') ) { + my $suffix = $conf->config('lpr-postscript_suffix'); + $ps .= eval qq("$suffix"); + } + close POSTSCRIPT; return $ps; |