-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
PdfWriterThe PdfWriter component is affectedThe PdfWriter component is affectedis-featureA feature requestA feature request
Description
Explanation
The XmpInformation class for holding XMP metadata is currently restricted to read data. To actually update the data, the user has to mess with the associated XML through rdf_root. This may lead to strange results as well when first accessing a value and then updating it, as on the first read access, the values will be cached internally.
Code Example
from pypdf import PdfReader, PdfWriter
writer = PdfWriter(clone_from="file.pdf")
metadata = writer.xmp_metadata
assert metadata is not None
print(metadata.dc_author)
metadata.dc_author = "Foo Bar"
print(metadata.dc_author)
writer.write("output.pdf")Metadata
Metadata
Assignees
Labels
PdfWriterThe PdfWriter component is affectedThe PdfWriter component is affectedis-featureA feature requestA feature request