All pastes #1927716 Raw Edit

Something

public text v1 · immutable
#1927716 ·published 2010-08-28 15:00 UTC
rendered paste body
#!/usr/bin/perl -w

use strict;

die "Invalid Input" unless (@ARGV == 2);

open F, "pdftk $ARGV[0] output - uncompress dont_ask |"
  or die "Can't open input pipe: $!";
binmode F;
open G, "| pdftk - output $ARGV[1] compress dont_ask"
  or die "Can't open output pipe: $!";
binmode G;

while (<F>)
{
  s/\(SWIN\|[^)]+\)/( )/o;
  print G $_;
}

close G
  or die "Can't close output pipe: $!";
close F
  or die "Can't close input pipe: $!";