From 7409f698686642a83b15a6f51f9034d2b8086fbc Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 25 Apr 2007 00:54:55 +0000 Subject: [PATCH] add lpr-postscript_prefix and lpr-postscript_suffix config options for printer commands to place printer in postscript mode --- FS/FS/Conf.pm | 14 ++++++++++++++ FS/FS/cust_bill.pm | 11 +++++++++++ 2 files changed, 25 insertions(+) diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 93ecf30c7..b54d6f54f 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -649,6 +649,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 877d364e8..3af0c54a8 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2105,10 +2105,21 @@ sub print_ps { unlink("$lfile"); 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; -- 2.11.0