using the following snippit of code:*File: Bathgate_ASRs.pdf Author ->Bob Webster CreationDate ->D:20060817180621+01'00' Creator ->Writer Producer ->OpenOffice.org 2.0 Title ->COMPETITIVE SAFARI MD5 Checksum: 18221baccb3c49a73dc9772302897e50 Size: ~169 KB (173585)
sub check_file { my $file = shift; my $pdf = PDF::API2->open($file); my %info = $pdf->info; print "\n*File: $filename\n"; foreach my $key (sort keys %info) { print "$key ->"; print narrow_char($info{$key}); print "\n"; } open (FILE, $file); binmode(FILE); print "MD5 Checksum: ",Digest::MD5->new->addfile(*FILE)->hexdigest, +"\n"; close(FILE); my $size = (stat("$file"))[7]; my $orig_size = $size; if ($size < 1024) { print "Size: $size bytes\n"; $size = undef; } if ($size) { $size = int($size / 1024); if ($size && $size < 1024) { print "Size: ~$size KB ($orig_size)\n"; $size = undef; } } if ($size) { $size = int($size / 1024); print "Size: ~$size MB ($orig_size)\n"; } }
What I now want find out two more things: the version of the pdf format, and the number of pages in the document... anyone got any hints?
In reply to Getting details from pdf files.. by kiz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |