erik
August 20, 2025, 2:29pm
1
Hi,
I have more than one DocumentVariable in one line, like so:
DocVar1 DocVar2
The Content of the Variables look like this:
when i replace that with document.Content.Find(…).ToList().Foreach(cur => cur.LoadText(HTMLTEXT…)
then the resulting docx/pdf looks like this
→ the second (or more) variable doesn’t get replaced correctly.
the same would happen to the first variable if i just put a whitespace at the beginning of the line.
can i keep the formatting for the following variables somehow?
Hi,
Unfortunately, without reproducing your issue and investigating the documents, it’s difficult to suggest anything.
Nevertheless, can you try the following:
document.Content.Find(…).Reverse().ToList().Foreach(cur => cur.LoadText(HTMLTEXT…)
If the problem remains, please send us a small Visual Studio project that reproduces your issue so we can investigate it.
Regards,
Mario
erik
August 21, 2025, 8:24am
3
i tried to create a sample project and it seems the problem is not gembox but some of our code.
gembox is replacing it correctly if i remove some other operations before it.
please close this topic. thanks