I have been trying to use CAM:PDF::Annot for it's most basic purpose, aggregating the annotations of two pdf's, but have not had any success.
I have been trying to emulate what is in the package's synopsis on CPAN, but keep coming up with an error.
The code in the CPAN synopsis (as a completed script), or any advice would be helpful.
CPAN page: http://metacpan.org/pod/CAM::PDF::Annot
So far I have:
#!/usr/bin/perl
use strict
use CAM::PDF;
use CAM::PDF::Annot;
sub main()
{
my $pdf = CAM::PDF::Annot->new( 'testAnnotPDF.pdf' );
my $otherDoc = CAM::PDF::Annot->new( 'testAnnotPDF2.pdf' );
my $page = 1;
my %refs;
my $hrefs = \%refs;
for my $annotRef (@{$pdf->getAnnotations($page)}){
$otherDoc->appendAnnotation( $page, $pdf, $annotRef, $hrefs );
}
$otherDoc->output('pdf_merged.pdf');
}
exit main;