The XmpInformation Class

class PyPDF2.xmp.XmpInformation(stream: PyPDF2.generic._data_structures.ContentStream)[source]

Bases: PyPDF2.generic._base.PdfObject

An object that represents Adobe XMP metadata. Usually accessed by xmp_metadata()

Raises

PdfReadError – if XML is invalid

property custom_properties: Dict[Any, Any]

Retrieve custom metadata properties defined in the undocumented pdfx metadata schema.

Returns

a dictionary of key/value items for custom metadata properties.

property dc_contributor: Optional[List[str]]

Contributors to the resource (other than the authors). An unsorted array of names.

property dc_coverage: Optional[Any]

Text describing the extent or scope of the resource.

property dc_creator: Optional[List[Any]]

A sorted array of names of the authors of the resource, listed in order of precedence.

property dc_date: Optional[List[Any]]

A sorted array of dates (datetime.datetime instances) of significance to the resource. The dates and times are in UTC.

property dc_description: Optional[Dict[Any, Any]]

A language-keyed dictionary of textual descriptions of the content of the resource.

property dc_format: Optional[Any]

The mime-type of the resource.

property dc_identifier: Optional[Any]

Unique identifier of the resource.

property dc_language: Optional[List[str]]

An unordered array specifying the languages used in the resource.

property dc_publisher: Optional[List[str]]

An unordered array of publisher names.

property dc_relation: Optional[List[str]]

An unordered array of text descriptions of relationships to other documents.

property dc_rights: Optional[Dict[Any, Any]]

A language-keyed dictionary of textual descriptions of the rights the user has to this resource.

property dc_source: Optional[Any]

Unique identifier of the work from which this resource was derived.

property dc_subject: Optional[List[str]]

An unordered array of descriptive phrases or keywrods that specify the topic of the content of the resource.

property dc_title: Optional[Dict[Any, Any]]

A language-keyed dictionary of the title of the resource.

property dc_type: Optional[List[str]]

An unordered array of textual descriptions of the document type.

getElement(aboutUri: str, namespace: str, name: str) Iterator[Any][source]

Deprecated since version 1.28.0: Use get_element() instead.

getNodesInNamespace(aboutUri: str, namespace: str) Iterator[Any][source]

Deprecated since version 1.28.0: Use get_nodes_in_namespace() instead.

get_element(about_uri: str, namespace: str, name: str) Iterator[Any][source]
get_nodes_in_namespace(about_uri: str, namespace: str) Iterator[Any][source]
property pdf_keywords: Optional[Any]

An unformatted text string representing document keywords.

property pdf_pdfversion: Optional[Any]

The PDF file version, for example 1.0, 1.3.

property pdf_producer: Optional[Any]

The name of the tool that created the PDF document.

property rdfRoot: xml.dom.minidom.Element
writeToStream(stream: Union[_io.BytesIO, _io.BufferedReader, _io.BufferedWriter, _io.FileIO], encryption_key: Union[None, str, bytes]) None[source]

Deprecated since version 1.28.0: Use write_to_stream() instead.

write_to_stream(stream: Union[_io.BytesIO, _io.BufferedReader, _io.BufferedWriter, _io.FileIO], encryption_key: Union[None, str, bytes]) None[source]
property xmp_createDate: datetime.datetime
property xmp_create_date: Optional[Any]

The date and time the resource was originally created. The date and time are returned as a UTC datetime.datetime object.

property xmp_creatorTool: str
property xmp_creator_tool: Optional[Any]

The name of the first known tool used to create the resource.

property xmp_metadataDate: datetime.datetime
property xmp_metadata_date: Optional[Any]

The date and time that any metadata for this resource was last changed.

The date and time are returned as a UTC datetime.datetime object.

property xmp_modifyDate: datetime.datetime
property xmp_modify_date: Optional[Any]

The date and time the resource was last modified. The date and time are returned as a UTC datetime.datetime object.

property xmpmm_documentId: str
property xmpmm_document_id: Optional[Any]

The common identifier for all versions and renditions of this resource.

property xmpmm_instanceId: str
property xmpmm_instance_id: Optional[Any]

An identifier for a specific incarnation of a document, updated each time a file is saved.