#!/usr/bin/perl # This script prepares the production of pdfs # of search results. # # copyright (c) Hans-Michael Muller, Pasadena, California, 2002-2004 # use strict; use CGI; ### globals # # handle to this CGI and own address my $query = new CGI; my $absmyself = $query->url(absolute=>1); # cookies my %generalsettings = $query->cookie('generalsettings'); # general settings my %displayoptions; # display options if ($query->cookie('displayoptions')) { %displayoptions = $query->cookie('displayoptions'); } else { $displayoptions{'Source Type'} = 1; $displayoptions{Title} = 1; $displayoptions{Abstract} = 1; $displayoptions{Author} = 1; $displayoptions{Journal} = 1; $displayoptions{Year} = 1; $displayoptions{Citation} = 1; $displayoptions{'Number of matches'} = 1; $displayoptions{Select} = 1; } my %displayvalues; # display values if ($query->cookie('displayvalues')) { %displayvalues = $query->cookie('displayvalues'); } else { $displayvalues{ResultsPerPage} = 10; $displayvalues{SentencesPerMatch} = 10; } # ### end of globals ### process form # # nothing to process in this version # ### PrintHeader($query, \%displayoptions, \%displayvalues); ### start form # print $query->start_form(-method => 'POST', -action => 'producepdf.cgi'); # ### ### first part of output goes here # # ### ### present input fields # print $query->p; print $query->submit(-name => 'start', -value => 'Start Processing'); # ### ### end form here # print $query->hidden(-name => 'id', -default => $query->param('id')); print $query->end_form; print $query->end_html; # ### sub PrintHeader { # begin PrintHeader my $query = shift; my $pDisplayoptions = shift; my $pDisplayvalues = shift; my @cookies = (); while (@_) { push @cookies, shift(@_)} print $query->header(-cookie=>[@cookies]); print $query->start_html(-title=>'Generate PDF Output', -author=>'Hans-Michael Muller', -bgcolor => '#e6e6f6', -text=>'#000000', -link=>'#662222', -vlink=>'#993333'); print $query->br; print $query->font({-face => 'verdana, arial, helvetica', -size => '5'}, 'Generate Output in PDF Format'); print $query->p; print $query->font({-face => 'verdana, arial, helvetica'}, 'Depending on the volume of the requested output, generating the PDF file may take '); print $query->font({-face => 'verdana, arial, helvetica'}, 'up to 1 minutes. The current page limit is set to 200 pages. '); print $query->p; print $query->font({-face => 'verdana, arial, helvetica'}, 'You can control the PDF output by changing your '); print $query->font({-face => 'verdana, arial, helvetica'}, '\'Display Options\' in the \'Customization\' page. '); print $query->font({-face => 'verdana, arial, helvetica'}, 'You currently select to have displayed '); foreach my $key (keys % $pDisplayoptions) { print $query->font({-face => 'verdana, arial, helvetica'}, $key); print $query->font({-face => 'verdana, arial, helvetica'}, ' (controls whether matching sentences are shown in PDF)') if ($key eq 'Select'); print $query->font({-face => 'verdana, arial, helvetica'}, ', '); } print $query->br; print $query->font({-face => 'verdana, arial, helvetica'}, 'and you choose to have '); print $query->font({-face => 'verdana, arial, helvetica'}, $$pDisplayvalues{SentencesPerMatch}); print $query->font({-face => 'verdana, arial, helvetica'}, ' sentences around a match displayed. '); print $query->p; } # end PrintHeader