Created
June 22, 2015 13:40
-
-
Save fruitl00p/1aee75a350138f9130b3 to your computer and use it in GitHub Desktop.
swf2pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
$swf = $ARGV[0]; | |
open A,"swfdump $swf |"; | |
while (<A>){ | |
if(/SHOWFRAME\s+(\d+)/){ | |
$page = $1; | |
} | |
} | |
close A; | |
print $page,"\n"; | |
for $i (1..$page){ | |
system qq(swfrender -r 240 -p $i $swf -o tmp_$i); | |
system qq(convert tmp_$i tmp_$i.pdf); | |
unlink("tmp_$i"); | |
push @outs, "tmp_$i.pdf"; | |
} | |
system qq(pdfunite @outs $swf.pdf); | |
unlink @outs; | |
print $swf, " done\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
open A,"swfdump $swf |";
while (){
if(/SHOWFRAME\s+(\d+)/){
$page = $1;
}
}
close A;
print $page,"\n";
for $i (1..$page){
system qq(swfrender -r 240 -p $i $swf -o tmp_$i);
system qq(convert tmp_$i tmp_$i.pdf);
unlink("tmp_$i");
push @Outs, "tmp_$i.pdf";
}
system qq(pdfunite @Outs $swf.pdf);
unlink @Outs;
print $swf, " done\n";