CAM::PDF::Annot::Parsed - Perl extension for pluggable parsing for PDF Annotations
# Define a parsing interface for the annotations package MyYAMLTinyParser; use base qw(YAML::Tiny); # MUST DEFINE parse METHOD!! it takes as input the string contents # of the pdf annotations and must spit out the inflated version of it sub parse { return shift->read_string( shift )->[0] } 1; package main; my $pdf = CAM::PDF::Annot::Parsed->( 'file.pdf', 'MyYAMLTinyParser' ); for my $parsed_annot ( @{$pdf->getParsedAnnots} ) { # Since I am using YAML::Tiny to parse it, each $parsed_annot # is a YAML::Tiny object # if document has annotations with the mask: #author: # name: Donato Azevedo # print $parsed_annot->[0]{author}{name}, "\n"; }
This module provides a way to use a pluggable parser to process comments on annotations of PDF documents. Annotations are free text strings generally contained in pop ups for drawing markups of PDF documents.
Constructor
my $p = CAM::PDF::Annot::Parsed->new($file, $parser);
Creates an instance of the object
my $arrRef = $p->getParsedAnnots( $page );
Returns a reference to an array containing the objects parsed by $parser (as passed to the constructor).
CAM::PDF CAM::PDF::Annot
Donato Azevedo, <donatoaz@gmail.com>
Copyright (C) 2009 by Donato Azevedo
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install CAM::PDF::Annot::Parsed, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CAM::PDF::Annot::Parsed
CPAN shell
perl -MCPAN -e shell install CAM::PDF::Annot::Parsed
For more information on module installation, please visit the detailed CPAN module installation guide.