#! /usr/bin/perl -w use strict; use warnings; use diagnostics; use lib qw(../perllib/); use PDF::Create; use CGI; use CGI::Carp qw(fatalsToBrowser); #use DBI; my $cgi = CGI->new(); #print $cgi->header(-type => 'text/html'); print $cgi->redirect(-url => 'http://www.urlaub-im-ferienpark.de/tmp/testpdf.pdf'); my $pdf = new PDF::Create('filename' => '../tmp/testpdf.pdf', 'Version' => 1.2, 'PageMode' => 'UseOutlines', 'Author' => 'Renee Baecker ', 'Title' => 'Ferienparkdetails'); my $root = $pdf->new_page('MediaBox' => $pdf->get_page_size("a4")); # Add a page which inherits its attributes from $root my $page = $root->new_page; # Prepare 2 fonts my $f1 = $pdf->font('Subtype' => 'Type1', 'Encoding' => 'WinAnsiEncoding', 'BaseFont' => 'Helvetica'); my $f2 = $pdf->font('Subtype' => 'Type1', 'Encoding' => 'WinAnsiEncoding', 'BaseFont' => 'Helvetica-Bold'); my $logo = $pdf->image('../tmp/EULE1.jpg'); my $arrow = $pdf->image('../tmp/arrow.gif'); $page->stringl($f2,15,20,780,'Informationen zum Ferienpark'); $page->image('image' => $logo, 'xpos' => 30 , 'ypos' => 600); # add the logo of parc $page->image('image' => $arrow, 'xpos' => 400, 'ypos' => 690); # add arrow of navigation $page->stringl($f1, 10, 420, 765, 'Beschreibung'); $page->image('image' => $arrow, 'xpos' => 400, 'ypos' => 660); # add arrow of navigation $page->stringl($f1, 10, 420, 735, 'Kontakt'); $page->image('image' => $arrow, 'xpos' => 400, 'ypos' => 630); # add arrow of navigation $page->stringl($f1, 10, 420, 705, 'Bewertungen'); $page->image('image' => $arrow, 'xpos' => 400, 'ypos' => 600); # add arrow of navigation $page->stringl($f1, 10, 420, 675, 'Sonstiges'); $page->stringc($f2, 8, 300, 2, "Created by http://www.Urlaub-im-Ferienpark.de"); # Add the missing PDF objects and a the footer then close the file $pdf->close; print $cgi->h2('PDF erzeugt');