1

In short: I'm looking for a way for a (known) UUID to be associated with a paragraph and/or text run.

I'm using dolanmiu/docxjs for exporting docx, and was extending the Paragraph and TextRuns to add my own metadata (uuids) on export. And have them stay in the docx after saving in MS Word, Google Docs, LibreOffice.

I have control over the exported xml, and on import convert docx to xml to parse. But I have control over what editor is used between export and import to edit the docx.

I've tried custom/arbitrary metadata on the paragraph / textrun level. As well as custom node types, but these all seem to be stripped on save.

The solution doesn't need to be inline with the document.xml, as I have seen some articles about having a separate custom.xml of data to be part of the docx, but I'm not sure how to relate a TextRun to it's uuid in the separate file (syntax wise in document.xml especially).

I came across this link: Is it possible to add some data to a Word document? , but that seems to be metadata at the document level and not more granular to the paragraph / text nodes.

Things I've tried:

Is there a way to add this custom metadata at a paragraph / text level in a docx that won't be stripped when edited and saved by a word processor?

theProf
  • 11
  • 3

0 Answers0