When using IReplacingCallback to replace a wildcard with html surrounded in a bookmark, the bookmark is not written to the document when the html contains a table.
A sample can be downloaded here:
https://1drv.ms/u/s!AkCkc0juiTKe2gFAsRguU4nJifJV
It appears to only happen when the replacement starts with .
@robschenkel,
You can workaround this problem by inserting a dummy invisible Paragraph before the Table as follows:
switch (id)
{
case 1:
{
builder.InsertHtml("This is some plain text", true);
break;
}
case 2:
{
builder.InsertHtml("<p>This is some <strong>HTML</strong> text</p>", true);
break;
}
case 3:
{
builder.InsertHtml("<p style='margin-top:0pt; margin-bottom:0pt; font-size:1pt'><span> </span></p><table><thead><tr><th>Column1</th><th>Column2</th></tr></thead><tbody><tr><td>1, 1</td><td>1, 2</td></tr></tbody></table>", true);
break;
}
}
Hope, this helps.
Best regards,