I would like to read the meta information from PDF using the Perl module Image :: ExifTool . I need to process PDF files using cross-references (like PDF 1.5), and other well-installed modules like PDF :: API2 and CAM :: PDF do not seem to support them or have limited support.
In any case, Image :: ExifTool seems to be reading a few PDF tags , but if I ran the following code:
use Image::ExifTool qw(:Public);
my $file = 'file.pdf';
my $exifTool = new Image::ExifTool;
$exifTool->ExtractInfo($file);
my @tagList = $exifTool->GetFoundTags('File');
for (@tagList){
print "$_\n"
}
I can't seem to get more of these tags:
ExifToolVersion
FileName
Directory
FileSize
FileModifyDate
FileAccessDate
FileCreateDate
FilePermissions
FileType
FileTypeExtension
MIMEType
PDFVersion
Linearized
Author
CreateDate
Creator (1)
ModifyDate
Producer (1)
Subject
Title (1)
XMPToolkit
CreateDate (1)
CreatorTool
ModifyDate (1)
MetadataDate
Producer
Format
Title
Description
Creator
DocumentID
InstanceID
PageLayout
PageMode
PageCount
In particular, I would like to get, for example, a catalog of PDF documents (Root tag). However, running such code does not return any value:
my $tag = 'Root';
my $exifTool = new Image::ExifTool;
my $info = $exifTool->ImageInfo($file, $tag);
for (sort keys %$info) {
print "$_ => $$info{$_}\n";
}
Help me please: -)