vinothjaguva has asked for the wisdom of the Perl Monks concerning the following question:
How to get PDF information using PDF::API2
This below code will display page count information
use strict; use vars qw(@ISA %pgsz $VERSION); @ISA = qw(PDF::API2::Basic::PDF::Pages); use PDF::API2::Basic::PDF::Pages; use PDF::API2::Basic::PDF::Utils; use PDF::API2::Util; use PDF::API2::Annotation; use PDF::API2::Content; use PDF::API2::Content::Text; use PDF::API2::Util; use POSIX qw(floor ceil); use Math::Trig;use strict; use PDF::API2; my $pf = 'mypdffile.pdf'; my $pdf = PDF::API2->open($pf) or die $!; print "Starting analysis of $pf...\n"; my $pagenumber = $pdf->pages; print "$pagenumber pages.\n"; my %opts = $pdf->info; while (my ($k, $v) = each %opts) { print "option $k is: $v\n" }
I want to get info what kind of page label is used for PDF page i.e. Roman/Arabic or named page.
|
|---|