purl's posterous

« Back to posts
  • Viewed
    times
June 20, 2011

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

  • Edit
  • Delete
  • Tags
  • Autopost

#!/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);

Tweet
  • 0 responses
  • Like
  • Comment