PdfMetadata
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 import PdfMetadataMethods
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_author
def set_author(self, value: str) -> NoneSets the name of the person that created the document.
Parameters:
| Name | Type | Description |
|---|---|---|
value | str | The value to set for the Author property. |
set_creator
def set_creator(self, value: str) -> NoneSets the name of the application that created the original document.
Parameters:
| Name | Type | Description |
|---|---|---|
value | str | The value to set for the Creator property. |
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. |
set_keywords
def set_keywords(self, value: str) -> NoneSets the keywords associated with the document.
Parameters:
| Name | Type | Description |
|---|---|---|
value | str | The value to set for the Keywords property. |
set_producer
def set_producer(self, value: str) -> NoneSets the name of the application that converted the document to PDF.
Parameters:
| Name | Type | Description |
|---|---|---|
value | str | The value to set for the Producer property. |
set_subject
def set_subject(self, value: str) -> NoneSets the subject of the document.
Parameters:
| Name | Type | Description |
|---|---|---|
value | str | The value to set for the Subject property. |
set_title
def set_title(self, value: str) -> NoneSets the title of the document.
Parameters:
| Name | Type | Description |
|---|---|---|
value | str | The value to set for the Title property. |
set_xmp
def set_xmp(self, value: str) -> NoneSets the XMP metadata stream of the document.
Parameters:
| Name | Type | Description |
|---|---|---|
value | str | The value to set for the XMP property. |
Properties
author
@propertydef author(self) -> strGets the name of the person that created the document.
Type: str
Read-only property.
creation_date
@propertydef creation_date(self) -> strGets the date and time the document was created.
Type: str
Read-only property.
creator
@propertydef creator(self) -> strGets the name of the application that created the original document.
Type: str
Read-only property.
keywords
@propertydef keywords(self) -> strGets the keywords associated with the document.
Type: str
Read-only property.
modification_date
@propertydef modification_date(self) -> strGets the date and time the document was most recently modified.
Type: str
Read-only property.
producer
@propertydef producer(self) -> strGets the name of the application that converted the document to PDF.
Type: str
Read-only property.
subject
@propertydef subject(self) -> strGets the subject of the document.
Type: str
Read-only property.
title
@propertydef title(self) -> strGets the title of the document.
Type: str
Read-only property.
xmp
@propertydef xmp(self) -> strGets the XMP metadata stream of the document.
Type: str
Read-only property.