sub my_header { # ... do your own stuff: print "Got parameters @_\n"; # Call old header routine to output other stuff header(); }; my $pdf = PDF::API2::Simple->new( header => \&my_header, footer =>\&footer, margin_left => 15, margin_top => 15, margin_right => 15, margin_bottom => 45 );