I write some PDF properties within an windows 7 commandline batch:
exiftool.exe my.pdf -Title=%TITLE% -Keywords=%KEYWORDS%
The variables enclosed in %-characters are SET with
SET TITLE="My Title"
SET KEYWORDS="Keyword 1, Keyword 2, Keyword 3"
and so on, the valueas are always enclosed with quotes (http://www.fileformat.info/info/unicode/char/22/index.htm).
How can I prevent that this quotes will be written in the properties as soon as character like , or ; is inside the value?
If I execute
exiftool.exe my.pdf -Keywords="Keyword1, Keyword 2, Keyword 3"
the quotes are visible in the Adobe reader, CTRL-D.
If I execute
exiftool.exe my.pdf -Keywords="Keyword1 Keyword 2 Keyword 3"
(without a , between the values)
the quotes are NOT visible in the Adobe reader, CTRL-D.
I think that reading FAQs number 3 and 17 (https://exiftool.org/faq.html) will answer your questions.
- Phil
Thank you for the hint. You mean this points?
List items are assigned separately, NOT all together, because this would represent a single keyword:
exiftool -keywords="one, two, three" test.jpg (WRONG!)
With exiftool version 7.56 or later, the -sep option may be used to split values of list-type tags into separate items when writing. For example,
exiftool -sep ", " -keywords="one, two, three" DIR
If I try
exiftool -sep ", " -keywords="one, two, three" "my.pdf"
I still get quotes at the first and last position of this 3 keywords ("one, two, three")
The same with
exiftool -keywords="one" -keywords="two" -keywords="three" "my.pdf"
Not only quotes at first/last position, comma-separators will be added too ("one, two, three")
Could you please tell me, which syntax would write the keywords WITHOUT quotes?
For me, it would be perfect with:
one, two, three
Great, you read FAQ number 17.
Now, try extracting the information with exiftool as per FAQ 3. My guess is that Adobe Reader is adding quotes.
- Phil
You are right.
exiftool -a "my.pdf" shows:
Keywords : one1, two2, three3
without quotes. The same in the ExifToolGUI.
Adobe Reader seems to add quotes in the view if , or ; are present in a property field.
*strange*
Hi, Phil
I found that problem too.
I tried to check keywords with Adobe Acrobat (9.x) and the found next:
When I add keywords with Adobe Acrobat it does not add quotes. AND!! In that Case Dublin Core Properties dc:subject (bag container) consists of different item for each keyword
If I add keywords by command:
exiftool -charset Cyrillic -sep "," -Keywords="kword, kword2, kword3, kword4" test.pdf
Adobe adds quotes, It is feature of Adobe.
AND Dublin Core Properties dc:subject (bag container) consists ONLY ONE item for all keywords
I attached screens of both cases. 1-st, and 2-nd
The same situation is with Authors
Finally, I found HOW TO SUPRESS quotes.
Whet it open file, it checks "dc" containers, as minimum Subject and Creator, and fill its own tags.
For example, if run next code only:
exiftool -charset Cyrillic -sep ", " -Subject="kword, kword2, kword3, kword4" test.pdf
exiftool -charset Cyrillic -sep ", " -Creator="LastName1 Fn1.Mn1, LastName2 Fn2.Mn2, LastName3 Fn3.Mn3, LastName4 Fn4.Mn4." test.pdf
Exiftool corrects missing -keywords switch and add Keywords Tag, But tag Author is missing in the pdf file. However, when that pdf is open by adobe (I used ACROBAT PRO 9.x) in the properties window we found almost correct keywords list without quotes, but with added null first keywords (3-rd screen attached), AND!!! correct Author field. If we check Additional Metadata we found filled all fields Keywords, Author, dc:Creator, dc:Subject (screen 4)
If we try to get metadata by ExifTool BEFORE open file in Adobe, we do not find TAG name AUTHOR. After, we found Tag AUTHOR with ONLY FIRST!!! Author from list filled. It is Adobe feature
So, For correct filling Keywords list and Authors list in PDF files we need run next command line:
exiftool -charset Cyrillic -sep ", " -Subject="kword, kword2, kword3, kword4" test.pdf
exiftool -charset Cyrillic -sep ", " -Keywords="kword, kword2, kword3, kword4" test.pdf
exiftool -charset Cyrillic -sep ", " -Creator="LastName1 Fn1.Mn1, LastName2 Fn2.Mn2, LastName3 Fn3.Mn3, LastName4 Fn4.Mn4." test.pdf
exiftool -charset Cyrillic -sep ", " -Author="LastName1 Fn1.Mn1, LastName2 Fn2.Mn2, LastName3 Fn3.Mn3, LastName4 Fn4.Mn4." test.pdf
Screens 5 and 6 shows Properties in Adobe After that code. All correct. Although, on the 6 screen we found that pdf Author tag has only first Author name. But with ExifTool we get full list of authors.
I think this information will be helpful for others
Yours, Andrey