Skip to content

Conversation

@liZe
Copy link
Member

@liZe liZe commented Jan 12, 2026

The new API is:

weasyprint invoice.html invoice.pdf --attachment=factur-x.xml --attachment-relationship=Data --xmp-metadata=rdf.xml --pdf-variant=pdf/a-3a

The Python API has also been simplified:

from weasyprint import Attachment, HTML

document = HTML("invoice.html").render()

factur_x_xml = Path("factur-x.xml").read_text()
attachment = Attachment(string=factur_x_xml, name="factur-x.xml", relationship="Data")
document.metadata.attachments = [attachment]

xmp_metadata = Path("rdf.xml").read_text().encode()
document.metadata.xmp_metadata = [xmp_metadata]

document.write_pdf("invoice.pdf", pdf_variant="pdf/a-3b")

Fix #2583.

@liZe liZe added the feature New feature that should be supported label Jan 12, 2026
@liZe liZe added this to the 68.0 milestone Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature that should be supported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Factur-X/XRechnung missing CLI options

2 participants