Provides access to PDF document metadata properties including standard document information dictionary fields and XMP metadata.
This class allows reading and writing of standard PDF metadata fields such as title, author, subject, and keywords, as well as custom metadata properties. All changes to metadata properties are immediately applied to the underlying PDF document.
from nutrient_sdk import PdfMetadataConstruction
PdfMetadata cannot be instantiated directly. Obtain instances through static factory methods or via other SDK classes.
Methods
get_custom_pdf_information
def get_custom_pdf_information(self, key: str) -> strGets the value of a custom metadata property from the document information dictionary.
Parameters:
| Name | Type | Description |
|---|---|---|
key | str | The name of the custom property to retrieve. |
Returns: str - The value of the custom property as a string. Returns an empty string if the property does not exist.
set_custom_pdf_information
def set_custom_pdf_information(self, key: str, value: str) -> NoneSets the value of a custom metadata property in the document information dictionary.
Parameters:
| Name | Type | Description |
|---|---|---|
key | str | The name of the custom property to set. |
value | str | The value to assign to the custom property. |
Properties
author
@propertydef author(self) -> str
@author.setterdef author(self, value: str) -> NoneThe name of the person that created the document.
Type: str
creation_date
@propertydef creation_date(self) -> strThe date and time the document was created.
Type: str
Read-only property.
creator
@propertydef creator(self) -> str
@creator.setterdef creator(self, value: str) -> NoneThe name of the application that created the original document.
Type: str
keywords
@propertydef keywords(self) -> str
@keywords.setterdef keywords(self, value: str) -> NoneThe keywords associated with the document.
Type: str
modification_date
@propertydef modification_date(self) -> strThe date and time the document was most recently modified.
Type: str
Read-only property.
producer
@propertydef producer(self) -> str
@producer.setterdef producer(self, value: str) -> NoneThe name of the application that converted the document to PDF.
Type: str
subject
@propertydef subject(self) -> str
@subject.setterdef subject(self, value: str) -> NoneThe subject of the document.
Type: str
title
@propertydef title(self) -> str
@title.setterdef title(self, value: str) -> NoneThe title of the document.
Type: str
xmp
@propertydef xmp(self) -> str
@xmp.setterdef xmp(self, value: str) -> NoneThe XMP metadata stream of the document.
Type: str