$file1="$output"."$filename"; use PDF::Create; # initialize PDF my $pdf = PDF::Create->new('filename'=> "$file1",'CreationDate' => [ localtime ], ) || die "Could not initialize PDF."; # add a A4 sized page my $a4 = $pdf->new_page('MediaBox' => $pdf->get_page_size('A4')); # Add a page which inherits its attributes from $a4 my $page1 = $a4->new_page; # Prepare a font my $f1 = $pdf->font('BaseFont' => 'Helvetica'); #prompt for user input print "\n"; print "Name: "; $name=<>; print "Method: "; $method=<>; print "\n"; #get the date $date=localtime; # Write some text $page1->stringc($f1, 20, 306, 425, "$title"); $page1->stringc($f1, 20, 306, 375, "Author: $name"); $page1->stringc($f1, 20, 306, 350, "Method: $method"); $page1->stringc($f1, 20, 306, 300, "$date\n"); # Close the file and write the PDF $pdf->close || die "Could not write PDF.";