PDF Annotations as custom metadata

It is possible to create smart rules and groups using PDF Annotations as a criterion and also to do advanced search based on the value of PDF Annotations. I would like to include this metadatum in custom metadata in the inspector, but it doesn’t show up in the drop down list and adding a field with that name doesn’t work. Is that possible?

Welcome @KenT45
No annotations can’t be used in this way.

PDF Annotations are not really “metadata”, as they are part of PDF pages (checkout Apple’s PDFKit documentation). And they are not easily searchable, as they can be a lot of other things beside text – how would you search for a red ellipse drawn in a 3 pixel wide dotted line?
You could copy PDF Annotations to custom metadata fields with a script. But in my mind, that is not sensible: An Annotation can run over lines and lines of text or be just a highlight. Mapping that to custom metadata is tedious.

But if it’s not a data element, how does it work that I can have the count of annotations show up as a column in the item list? Actually, that column solved the problem I was trying to solve.

Are you just trying to use the number of annotations as a criterion?

This is possible, but tells you nothing about the annotations themselves…

I did not say that a PDF is “not a data element”. All I said is that “annotations are not really metadata”. Just because they are not metadata does not mean that you can’t count them.

Annotations are a property of the PDFPage object, an array of which is a property of the PDFDocument object (very loosely spoken). So, the annotations are always bound to the page they are defined on, not to the document as such. That makes them different from metadata like title, author etc.

As annotations is an array for each PDFPage, it’s trivial to count them and display the result somewhere. And originally, you were asking to use PDFAnnotations as “metadata”. I was referring to that.

If now you’re happy with the “number of annotations” – good for you. But why were you then asking for something else in the first place?