Subject: | Can't modify Outlines in existing document (+ maybe fixed) |
use strict;
use warnings;
use PDF::API2;
my $doc = PDF::API2-> open( 'sample.pdf' );
$doc-> outlines
-> outline
-> dest( $doc-> openpage( 1 ))
-> title( '1st page' );
$doc-> saveas( 'sample+.pdf' );
Can't locate object method "outline" via package "PDF::API2::Basic::PDF::Objind" at outline.pl line 7.
This particular document has empty outlines structure (as opposed to not having it at all), but script will also fail if there's any existing outlines.
To fix, insert after line 2334 in API2.pm:
bless $obj, 'PDF::API2::Outlines';
$obj-> {' apipdf'} = $self-> { pdf };
$obj-> {' api' } = $self;
Subject: | sample.pdf |
Message body not shown because it is not plain text.