4 %my($query) = $cgi->keywords;
5 %$query =~ /^((.+)-)?(\d+)(.pdf)?$/;
6 %my $templatename = $2;
9 %my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
10 %die "Invoice #$invnum not found!" unless $cust_bill;
12 %my $pdf = $cust_bill->print_pdf( '', $templatename);
14 %http_header('Content-Type' => 'application/pdf' );
15 %http_header('Content-Length' => length($pdf) );
16 %http_header('Cache-control' => 'max-age=60' );