in reply to Printing Labels
docx is "just" zipped XML, so use your document as a template and type in placeholders for the address details.
If you choose the identifiers for the placeholders uniquely enough, a regex will suffice, to fill in the data after unzipping.
I think this is the easiest and safest "migration path" from your old process. ;)
(I know it's a hack, but it worked for me)
HTH :)
Using unique <IDENTIFIERS> in the word editor should be fine. This can't collide with XML code because <> are escaped to HTML entities. Of course your regex must replace <IDENTIFIERS> then.
This has also the advantage that you can sanity check if placeholders were misspelled or new ones missed.
If I were you I would also fill the placeholders to the visual maximum size.
<_____IDENTIFIERS_____>
Like that you can catch overlong address data.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Printing Labels (updates 2)
by Fletch (Bishop) on Oct 08, 2024 at 15:28 UTC | |
by LanX (Saint) on Oct 08, 2024 at 17:08 UTC |