Erik de Castro Lopo wrote:
I have a small postscript file which is a template for a ticket.
I now need to find a way to add custom text to this file before
printing and I need to be able to do this from the command line.
If you are printing via CUPS then you can add a custom filter that
modifies the file before it is sent to the printer. I do this for a
custom label that cannot be modified when the job is generated.
In the printer ppd file add a line like:
*cupsFilter: "application/vnd.cups-postscript 0 hplabel"
where "hplabel" is the name of the filter file.
This is the contents of the hplabel filter file:
#!/usr/bin/perl
while (<STDIN>) {
s/5 5 265 385/5 5 220 385/;
s/297 420/225 395/;
print STDOUT "$_";
}
This file should be made executable and placed in the cups filer
directory. On my debian system that is /usr/lib/cups/filter/
--
Mark Pearson BSc (Computing)
Technical Support, Dept Nuclear Medicine
Concord Hospital, Hospital Road, Concord, NSW 2139, Australia
Phone:+61-2-97676339 or +61-297677450; FAX:+61-2-97677451
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html