B
Brian
I am processing print job files. They all contain a Start banner with plain
text then following the banner comes the data to be printed. This data can
either be plain text or PCL (binary). I need to be able to determine what
format the data is in because the processing is different. I tried using -T
and -B on the file, but Perl returns -T as TRUE, I guess becuase of the
plain text header. The PCL always starts with the string ^[E^[... so I
tried searching for that, but to no avail with the following code:
while ( <SRCFILE> ) {
if ( $_ =~ /\^\[E\^\[/ ) { # Does this line contain ^[E^[
$pclFlag = 1;
print " PCL File detected\n";
}
}
Here is an example of part of a print job file containing PCL data:
* PRINT TIME: 13:30:38
*
* PRINT DATE: 23 JUN 2006
*
* PRINT NAME: TA104002
*
* SYSTEM: MVSA
*
*
*
**START*****START*****START*****START*****START*****START*****START*****START**
^[E^[&u300D^[*v1O^[*v0N^[*c00001D^[)s64W@^B)$7^A^^¦^U^BÿªÃðÄðÇãñðãñåñððó÷^[*c0E^[(s17W^D^N^A^A^Ax^[*c1E^[(s17W^D^N^A^A^Ax^[*c2E^[(s17W^D
^N^A^A^Ax^[*c3E^[(s17W^D^N^A^A^Ax^[*c4E^[(s17W^D^N^A^A^Ax^[*c5E^[(s17W^D^N^A^A^Ax^[*c6E^[(s17W^D^N^A^A^Ax^[*c7E^[(s17W^D^N^A^A^Ax^[*c8E^[
(s17W^D^N^A^A^Ax^[*c9E^[(s17W^D^N^A^A^Ax^[*c10E^[
text then following the banner comes the data to be printed. This data can
either be plain text or PCL (binary). I need to be able to determine what
format the data is in because the processing is different. I tried using -T
and -B on the file, but Perl returns -T as TRUE, I guess becuase of the
plain text header. The PCL always starts with the string ^[E^[... so I
tried searching for that, but to no avail with the following code:
while ( <SRCFILE> ) {
if ( $_ =~ /\^\[E\^\[/ ) { # Does this line contain ^[E^[
$pclFlag = 1;
print " PCL File detected\n";
}
}
Here is an example of part of a print job file containing PCL data:
* PRINT TIME: 13:30:38
*
* PRINT DATE: 23 JUN 2006
*
* PRINT NAME: TA104002
*
* SYSTEM: MVSA
*
*
*
**START*****START*****START*****START*****START*****START*****START*****START**
^[E^[&u300D^[*v1O^[*v0N^[*c00001D^[)s64W@^B)$7^A^^¦^U^BÿªÃðÄðÇãñðãñåñððó÷^[*c0E^[(s17W^D^N^A^A^Ax^[*c1E^[(s17W^D^N^A^A^Ax^[*c2E^[(s17W^D
^N^A^A^Ax^[*c3E^[(s17W^D^N^A^A^Ax^[*c4E^[(s17W^D^N^A^A^Ax^[*c5E^[(s17W^D^N^A^A^Ax^[*c6E^[(s17W^D^N^A^A^Ax^[*c7E^[(s17W^D^N^A^A^Ax^[*c8E^[
(s17W^D^N^A^A^Ax^[*c9E^[(s17W^D^N^A^A^Ax^[*c10E^[