Skip to content

Provide a way to create XMP metadata from scratch #3394

@stefan6419846

Description

@stefan6419846

Explanation

Creating XMP metadata currently requires knowing the corresponding minimal structure. To improve the experience, we should provide a classmethod on the XmpInformation class and a short documentation for how to add such metadata.

Code Example

from pypdf import PdfReader, PdfWriter
from pypdf.xmp import XmpInformation

xmp_information: XmpInformation = XmpInformation.create()
writer = PdfWriter(clone_from="file.pdf")
writer.xmp_metadata = xmp_information
writer.write("output.pdf")

Metadata

Metadata

Assignees

No one assigned

    Labels

    PdfWriterThe PdfWriter component is affectedis-featureA feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions