Let's say I have a user-generated document template with placeholders and I want to replace them with actual values.
Values could be:
- scalars
- tables
- ...?
So far I wrote a simple find/replace tool that works with RTF format (because it's not a binary format), here's how it works:
set template = "D:\Cache\RTF\template.rtf"
set var("%title") = "Hello"
set var("%table") = $lb("Utils.RTF", "TestFunc")
set result = "D:\Cache\RTF\out.rtf"
set sc = ##class(Utils.RTF).replace(template, .var, result)There should be two placeholders in RTF template: %title and %table and the are replaced with "Hello" and






