Archive for November, 2006

how to take a PDF outta a cbprotect file

Friday, November 10th, 2006

#!/usr/bin/perl

open(FILE, $ARGV[0]);
@thefile = <FILE>;
close(FILE);

$found = 0;
foreach $line (@thefile) {
if($line =~ /%PDF/) {
$line =~ s/.*(%PDF.*)/$1/;
$found = 1;
}
print $line if($found);
}