use strict; use CGI; print "Content-type: text/html\r\n\r\n"; # PDF 2 JPEG CGI my %INPUT = &DecodeInURL(); my $PDF2JPGEXE = 'C:\_TestSite\PDF2JPG\bin\pdf2jpeg.exe'; my $PDFFile = $INPUT{"file"}; print "**$PDFFile<br>"; my $output = 'Out_Temp\TempPDF%3.3d.jpg'; my $PDF2JPG_OutPut = system("$PDF2JPGEXE -w -d 90 -q 80 -s 240 300 -f + $PDFFile $output"); print "<p>Output: $PDF2JPG_OutPut"; sub DecodeInURL { my $Decoded = $ENV{'QUERY_STRING'}; #Get Method my %INPUT; $Decoded =~ s/%([\a-fA-F0-9][a-fA-F0-9])/pack('C', hex($1))/eg; print "$Decoded\n"; my @INPUTVars = split /\&/ , $Decoded; foreach my $pair (@INPUTVars) { if ($pair=~m/([^=]+)=(.*)/) { my $field = $1; my $Value = $2; $Value =~ s/\+/ /g; $INPUT{$field}=$Value; return %INPUT; } } }
In reply to Re: Use Strict & subs
by swaroop.m
in thread Use Strict & subs
by Mayhem50
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |