I cannot find an "official" documentation on whether the keywords and keyword phrases in the meta data of a PDF file are to be separated by a comma or by a comma with space.
The following example demonstrates the difference:
- keyword,keyword phrase,another keyword phrase
- keyword, keyword phrase, another keyword phrase
Any high-quality references?
The online sources I found are of low quality. E.g., an Adobe press web page says "keywords must be separated by commas or semicolons", but in the example we see a semicolon with a following space before the first keyword and a semicolon with a following space between each two neighbor keywords. We don't see keyword phrases in the example.
3 Answers
The keywords metadata field is a single text field - not a list. You can choose whatever is visually pleasing to you. The search engine which operates on the keyword data may have other preferences, but I would imagine that either comma or semicolon would work with most modern search engines.
Reference: PDF 32000-1:2008 on page 550 at 1. Adobe; 2. The Internet Archive
ExifTool, for example parses for comma separated values, but if it does not find a comma it will split on spaces:
# separate tokens in comma or whitespace delimited lists my @values = ($val =~ /,/) ? split /,+\s*/, $val : split ' ', $val; foreach $val (@values) { $et->FoundTag($tagInfo, $val); } 5I dont have a "high-quality references" but, if i generated a pdf using latex i do it in the following way: adding in my main.tex following line:
\usepackage[a-1b]{pdfx} then i write a file main.xmpdata and add this lines:
\Title{My Title} \Author{My Name} \Copyright{Copyright \copyright\ 2018 "My Name"} \Kewords{KeywordA\sep KeywordB\sep KeywordC} \Subject{My Short Discription} after generating the pdf with pdflatex i used a python script based on "pdfminer.six" to extract the metadata
from pdfminer.pdfparser import PDFParser from pdfminer.pdfdocument import PDFDocument from pdfminer.pdftypes import resolve1 fp = open('main.pdf', 'rb') parser = PDFParser(fp) doc = PDFDocument(parser) parser.set_document(doc) if 'Metadata' in doc.catalog: metadata = resolve1(doc.catalog['Metadata']).get_data() print(metadata) # The raw XMP metadata The part with the Keywords then look like this:
...<rdf:Bag><rdf:li>KeywordA</rdf:li>\n <rdf:li>KeywordB... and looking with "Adobe Acrobat Reader DC" at the properties of "main.pdf" i find in the properties the following entry in the section keywords:
;KeywordA;KeywordB;KeywordC 1CommonLook claim to be "a global leader in electronic document accessibility, providing software products and professional services enabling faster, more cost-efficient, and more reliable processes for achieving compliance with the leading PDF and document accessibility standards, including WCAG, PDF/UA and Section 508."
They provide the following advice on PDF metadata:
Pro Tip: When you’re entering Keywords into the metadata, separate them with semicolons as opposed to commas.
although give no further reasoning as to why this is the preferred choice.