You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to add custom metadata for it to be shown on the Custom Properties of Adobe Reader.
When using meta[o2s:name_of_property]: "value_of_property", I get an error saying that the key "o2s" doesn't exists. I've solved that by using it like meta["{http://ns.o2sol.com/schema/pdf/1.4/}name_of_property"] = "value_of_property", which generates the following in the XML part of the PDF.
Well, this is irritating. The two XML excerpts you presented are both equivalent as defined by the RDF schema.
The output pikepdf produces, inline RDF, is fully compliant with the relevant specs, but it seems Adobe Reader doesn't care. pikepdf does not generate nested RDF because it's more complex to generate. There is currently no way to ask to it.
I assume you mean that the custom properties don't appear in this dialog box, and do appear if formatted according to Reader's preferred format.
I checked that changing the format in which XMP metadata is generated from inline to structured does not cause new custom properties to appear in the dialog box shown above. I believe the issue may be that the dialog box above is showing DocumentInfo rather XMP. You'll have to explain where in Adobe Reader I can confirm that your custom values are being shown.
Otherwise, it appears to me that the way pikepdf generates metadata is fine.
I've been trying to add custom metadata for it to be shown on the Custom Properties of Adobe Reader.
When using
meta[o2s:name_of_property]: "value_of_property"
, I get an error saying that the key "o2s" doesn't exists. I've solved that by using it likemeta["{http://ns.o2sol.com/schema/pdf/1.4/}name_of_property"] = "value_of_property"
, which generates the following in the XML part of the PDF.<rdf:Description xmlns:ns0="http://ns.o2sol.com/schema/pdf/1.4/" rdf:about="" ns0:name_of_property="value_of_property"/></rdf:RDF>
It seems that Adobe Reader doesn't detect that as a custom metadata property and it's expecting something like:
<rdf:Description xmlns:o2s="http://ns.o2sol.com/schema/pdf/1.4/"> <o2s:name_of_property>value_of_property</o2s:name_of_property> </rdf:RDF>
How can I add custom metadata properties using pikepdf's
open_metadata()
?Thanks for the help.
Versions:
pikepdf: 3.0.0
python: 3.9.7
The text was updated successfully, but these errors were encountered: