if (($option{'paper'}) && (uc($option{'paper'}) ne "LETTER"))
{&Warning("the set paper $option{'paper'} isn't supported\n$producer will use the default paper (letter)")}
}
my $typeencoding=$option{'typeencoding'};
if (($typeencoding ne "MacRomanEncoding") && ($typeencoding ne "MacExpertEncoding") && ($typeencoding ne "WinAnsiEncoding") && ($typeencoding ne "default"))
{&Warning("the set encoding $typeencoding isn't MacRomanEncoding or MacExpertEncoding or WinAnsiEncoding or default\n$producer will use the default encoding (ISOLatin1Encoding)")}
if ($option{'transition'} eq "replace") {$transition=""}
else {&Warning("the set direction $1 with $transition transition isn't supported\n$producer will use the $transition 0 direction")}
}
elsif ($option{'transition'}=~/blinds!(.*)!/)
{
$transition="Blinds";
if ($1 eq "H" || $1 eq "V") {$dimension=$1}
else {
&Warning("the set dimension $1 with $transition transition isn't supported\n$producer will use the $transition H dimension");
$dimension="H";
}
}
elsif ($option{'transition'}=~/split!(.*)!(.*)!/)
{
$transition="Split";
if ($1 eq "H" || $1 eq "V") {$dimension=$1}
else {
&Warning("the set dimension $1 with $transition transition isn't supported\n$producer will use the $transition H dimension");
$dimension="H";
}
if ($2 eq "I" || $2 eq "O") {$motion=$2}
else {
&Warning("the set motion $1 with $transition transition isn't supported\n$producer will use the $transition I (Input) motion");
$motion="I";
}
}
else {
if ($option{'transition'}) {
&Warning("the set transition $option{'transition'} isn't supported\n$producer will use the default transition (replace)");
$option{'transition'}="";
}
}
if (($option{'pagemode'} ne "FullScreen") && ($option{'pagemode'} ne "UseThumbs") && ($option{'pagemode'} ne "")){
&Warning("the set page mode $option{'pagemode'} isn't supported\n$producer will use the default page mode (UseNone)");
$option{'pagemode'}="";
}
if (($option{'pagelayout'} ne "OneColumn") && ($option{'pagelayout'} ne "TwoColumnRight") && ($option{'pagelayout'} ne "TwoColumnLeft") && ($option{'pagelayout'} ne "")) {
&Warning("the set page layout $option{'pagelayout'} isn't supported\n$producer will use the default page layout (SinglePage)");
$option{'pagelayout'}="";
}
if ($option{'bgdesign'})
{
open (BGDESIGN, "$option{'bgdesign'}") ||
die "$producer: couldn't open background design file $option{'bgdesign'}\n";
while (<BGDESIGN>) {
s/\015$//;
$bgdesign.=$_;
}
close(BGDESIGN);
}
if ($option{'fgdesign'})
{
open (FGDESIGN, "$option{'fgdesign'}") ||
die "$producer: couldn't open foreground design file $option{'fgdesign'}\n";
while (<FGDESIGN>) {
s/\015$//;
$fgdesign.=$_;
}
close(FGDESIGN);
}
sub wanted {
if ($File::Find::name=~/$match/) {
push @ARGV,$File::Find::name;
}
}
if ($match && !$recursive) {
print "You can use -match option only with -recursive option\n";
exit;
}
if ($recursive) {
$match=~s/\./\\./g;
$match=~s/\*/.*/g;
$match=~s/\?/./g;
$match=~s/$/\$/;
find (\&wanted,"$recursive");
}
if (@ARGV) {
my @files;
$obj=0;
$pageNO=0;
$fpos=0;
@pageObj='';
$verbose and $times = time;
open (OUT, ">$output") || die "$producer: couldn't open output file $output\n";
binmode (OUT);
&WriteHeader();
$i=0;
my $p;
if ($^O =~ /^MSWin32$/i && !$recursive) {
foreach $p (@ARGV) {
if($p=~/\*|\?/) {push @files,glob($p)}
else {push @files,$p}
}
}
else {@files = @ARGV}
foreach $input (@files) {
$verbose and print "Processing $input file\n";
&WriteImages($input);
}
$imagen=($#image+1)/3;
&WritePages();
&WriteRest();
close(OUT);
if ($verbose) {$timef = time; printf ("PDF generation time = %4.2f sec\n", $timef - $times );}
} else {printusage()}
sub WriteHeader {
my $sec=0; my $min=0; my $hour=0; my $mday=0; my $mon=0; my $year=0;
$buf=sprintf " /Font << /F1 %d 0 R /F2 %d 0 R /F3 %d 0 R /F4 %d 0 R /F5 %d 0 R /F6 %d 0 R /F7 %d 0 R /F8 %d 0 R /F9 %d 0 R /F10 %d 0 R /F11 %d 0 R /F12 %d 0 R /F13 %d 0 R /F14 %d 0 R >>\n",