我在获取exiftools为我的pdf文件编写自定义元标记时遇到问题。在安装了exiftools的MacOS终端中。这是一个示例命令。
exiftool -overwrite_original -config
new.config -XMP::pdfx:document_id=”7A 2017 091 d” -XMP::pdfx:description=”Booklet on stuff and more stuff” pdf_files/7A_2017_091_d.pdf
这是配置行:
#user-defined pdfs
%Image::ExifTool::UserDefined = (
'Image::ExifTool::XMP::pdfx' => {
document_id => { },
description => { },
},
);
1; #end
我得到的全部是:
Warning: Tag 'XMP::pdfx:Document_id' is not defined
Warning: Tag 'XMP::pdfx:Description' is not defined
Nothing to do.
我究竟做错了什么?
这是适合我的配置文件:
#user-defined pdfs
%Image::ExifTool::UserDefined = (
'Image::ExifTool::XMP::pdfx' => {
document_id => { Writable => 'string', },
description => { Writable => 'string',},
},
);
1; #end
并带有结果的命令行(你不需要配置文件来读取XMP标签,只需写入)
C:\>exiftool -config temp.txt -xmp-pdfx:document_id="test" -xmp-pdfx:description="Description Test" y:/!temp/test.pdf
1 image files updated
C:\>exiftool -xmp-pdfx:document_id -xmp-pdfx:description y:/!temp/test.pdf
Document id : test
Description : Description Test