Hi Phil
I am adding custom properties to pdf file using
%Image::ExifTool::UserDefined = (
'Image::ExifTool::PDF::Info' => {
TestTag => { },
},
);
But I am not able to remove it.
Could you please suggest a solution.
Thanks
Try this:
%Image::ExifTool::UserDefined = (
'Image::ExifTool::PDF::Info' => {
TestTag => {
Writable => 'string',
},
},
);
- Phil
Edit: Silly me. You can already write this value, so this won't do anything. To delete the value, use exiftool -testtag= FILE
Hi Phil,
Suppose I try to add a xmp metadata to a pdf file , for eg TestTag = somevalue. It gets added as Test Tag with a space in between. And when I try to change the value using exiftool.exe from cmd it says tag doesn't exist. What can be reason for that and how can i solve it.
Does this help?:
> exiftool a.pdf -testtag="this is a test"
1 image files updated
> exiftool a.pdf -testtag
Test Tag : this is a test
> exiftool a.pdf -testtag -s
TestTag : this is a test
> exiftool a.pdf -testtag=
1 image files updated
> exiftool a.pdf -testtag
>
- Phil
I did try this But the problem with this is it removes the value but the attribute stil remains and can be seen in custom document properties as well as if seen from cmd exiftool with attribute name and value as a blank.
stil it has the same problem tag doesnt exist
I have merged these two threads together. When you say "tage doesnt exist", do you mean you can't write the value of TestTag? Are you using the config file you posted? I need more details to be able to understand what you are doing. If you show your console log it would be useful.
- Phil
Hi Phil,
I have a doubt here. How can retrieve all custom properties added to a pdf that are stored using
%Image::ExifTool::UserDefined = (
'Image::ExifTool::PDF::Info' => {
$Name => { },
},
);
The pdf may have custom propperties as
Name Value
test test
test1 test1
-sumit
Hi Sumit,
ExifTool will read any PDF Info tags (https://exiftool.org/TagNames/PDF.html#Info) that exist. They only need to be pre-defined if you want to write them.
- Phil
Hi Phil
If I want to read only the custom properties and not other values lyk author or title. How am i suppose to do that using code.
Or suppose i write XMP metadata to pdf in a particular namespace say XYZ
How can i retrieve all values that are in the namespace XYZ
There are no namespaces in the PDF Info. If you are talking about XMP, this is done with -xmp-namespace:all.
- Phil
yeah i am talking about xmp not info dictionary
could u plz write a code for the same
The sample config file (https://exiftool.org/config.html) contains an example of how to create a new XMP namespace.
- Phil
Hi Phil
Sorry to bug u but I am talking about how to retrieve it using code not cmd line
Sorry, I didn't understand.
use Image::ExifTool qw(:Public);
my $info = ImageInfo('image.jpg', 'XMP-namespace:all');
- Phil
Hi Phil,
Is there any way to validate Pdf using exiftool or see if the xref table is valid
Thanks,
Sumit
Hi Sumit,
ExifTool is not a validation tool, but it will report some errors/warnings that you can retrieve like this:
exiftool -error -warning FILE
- Phil
Hi Phil
I am trying to add custom properties to a pdf, but it says invalid xref. could you plz help me with this
-sumit
If you can send me the PDF (philharvey66 at gmail.com), I'll take a look.
- Phil
Hi Phil.
I have send the mail and also attached the file in this commnet . Please have a look.
-sumit
Hi Sumit,
Thanks for the sample. ExifTool was not parsing the XREF table of this PDF properly. This problem will be fixed in ExifTool 9.21, which will likely be released tomorrow.
- Phil
Hi Phil,
We are using the perl module Image::Exiftool for reading and writing pdf properties.
Will this update be available in this module too ?
-sumit
Yes.
- Phil
Hi Phil,
This works like a charm. Thanks a lot again :)
-sumit