package Lpr_HP6MP;

use strict;
use vars qw(@ISA);

@ISA = ("Lpr_Module_Template");

# -----------------------------------------------------------------------------
# --

sub new() {

    my $class = shift;
    my $self  = { };

    bless($self, $class);    

    $self->{NAME} = "Lpr_HP6MP";

    return $self;
  }

# -----------------------------------------------------------------------------
# --

sub process_files() {

    my $self = shift;
    my $lpr  = shift;

    my $queue = $lpr->queue();
    my $files = $lpr->files();

    my @p_files = ();

    my $alt_queue = $queue;
    $alt_queue    =~ s/_text$//;

    foreach my $f (@$files) {

        if ($queue =~ m/_text$/) {
            my $a2ps_out_f = "/tmp/lpr_simonh_" . time . "_" . rand();

            print "\nMessages below are from a2ps : ";
            print "\n\n";
            system("/usr/local/bin/a2ps -o $a2ps_out_f $f"); 
            push(@p_files, $a2ps_out_f);
	  }
        else {
            push(@p_files, $f);
          }
      }
    return \@p_files;
  }

# -----------------------------------------------------------------------------
1;
# -----------------------------------------------------------------------------
