Hi Team,
We are having an issue with the placeholder value replacement in the word template in one of our application.
Users configures placeholder on the word template i.e. [%PlaceHolder%]
and application uses Aspose word library (version 10.0.7.0) to replace placeholder with the value.
It works fine for all the placeholders (starts with " [% " then text and end with " %] "
) but some placeholders were not getting replaced while processing.
Root cause:
After analysis we found issue occurs for some format sequence inserted by MS Word at background of the template whilst creating placeholder.
** For example: ** Below text was created in background
for [%Private Address Line 1%]
Please see the attachment 1.
While correct one would be:
please see the attachment 2.
Current Implementation:
We are using Aspose word (version 10.0.7.0) for word processing. We have a scenario in which we are replacing placeholders (for ex. [%ABC%]) with some values using replacing method (public override ReplaceAction Replacing(ReplacingArgs args)) of IReplacingCallback interface.
Code:
public override ReplaceAction Replacing(ReplacingArgs args)
{
return ReplaceWith(args, (builder) =>
{
if (TextColor != Color.Empty)
builder.Font.Color = TextColor;
builder.Write(ReplacementText);
});
}
Now a question is:
Is there any way to resolve above issue using Aspose word version 10.0.7.0.?
Or we need to upgrade it to latest version of aspose .