OdooWiki OCA HUB

PDF XML attachment

pdf_xml_attachment folder_open OCA/reporting-engine open_in_new
Tools License: LGPL-3

Technical module to share easily deal with XML attachments in PDF files.

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

This module provides technical helpers to read XML attachments embedded inside PDF files and to add an XML attachment into a PDF. It does not add menus or user screens; it is meant to be used by other modules or developers.

This is a technical tool module. It does not create any menu, screen, button or report for end users. Its purpose is to make it easier for other Odoo modules to work with XML files that are attached inside PDF documents.

The module adds a helper model called pdf.xml.tool. This helper offers two operations:

  • Extract XML attachments from a PDF: given the binary content of a PDF file, it returns a dictionary where each key is the attachment file name and each value is the parsed XML content. If the PDF cannot be parsed, the error is logged and an empty result is returned instead of crashing.
  • Embed an XML attachment into a PDF: given the binary content of a PDF, a file name and an XML string, it produces a new PDF that contains the XML as an attachment and opens the PDF with the attachments panel visible.

Only files that can be parsed as XML are kept when extracting; other embedded files are ignored. The module depends only on the base module and does not modify any business documents, sales, invoices, stock or accounting data. It is intended as a building block for other modules that need to exchange data through PDF files containing XML attachments.

Depends on

base
Models and fields (1)
  • pdf.xml.tool · new model

Text generated by AI (DeepSeek) from reading the Odoo 19.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 2 confirmed, 7 with no information of 9 versions.

Sources · Odoo 19.0

Confirmed on 2026-11-03 in branch 19.0 of OCA/reporting-engine.

terminal Installation and usage

OCA documentation · Odoo 19.0

Inside Odoo env:

res = env["pdf.xml.tool"].pdf_get_xml_files(pdf_filecontent)

new_pdf_filecontent = env["pdf.xml.tool"].pdf_embed_xml(pdf_filecontent, filename, xml)

Outside Odoo env:

from odoo.addons.pdf_xml_attachment.utils import PDFParser [...] res = PDFParser(pdf_filecontent).get_xml_files()

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.