2011年6月20日星期一

rotate vertical PDF 270 degrees into PNG, for the wide screen devices

#!/usr/bin/perl -w

use CGI;

my $q = CGI->new;

my $f = $q->upload('upfile');

print "Content-Type: image/png\n\n";

open PDF, q(>), q(/tmp/t.pdf);

print PDF while (<$f>);

close PDF;

system qq(convert /tmp/t.pdf -rotate 270 /tmp/t.png);

print qx(cat /tmp/t.png);

Posted via email from purl's posterous

没有评论: