in reply to PDF Information fields: Modifying

Here is the code to change the title for a PDF. This should get you pointed in the right direction:
#!/usr/bin/perl use PDF::API2; $pdf = PDF::API2->open('test.pdf'); #%info = $pdf->info; $font = $pdf->corefont("Times-Roman"); $info{Title} = $font->text( "New Title"); $pdf->info (%info); $pdf->update; $pdf->saveas("newfile.pdf");
PDF::API2 is on CPAN

HTH, --traveler

Replies are listed 'Best First'.
Re: Re: PDF Information fields: Modifying
by cardozo (Novice) on Sep 10, 2002 at 15:36 UTC
    When trying this code, I get the error:

    Can't call method "out_file" on an undefined value at /apps/PERL5/lib/perl5/site_perl/5.6.1/PDF/API2.pm line 587.

    Any ideas why?

      I suspect the issue is that you don't have a file called test.pdf...

      --traveler