Thanks for the quick response.
Removing the unmerged fields can’t meet our requirement exactly after thinking further.
For #1, we would like all the fields are merged with our predefined data for the validation. If the unmerged fields are removed during validation, that means they are not validated. When real data are provided to this template those fields may fail to be merged for potential definition mistakes;
For #2, we can’t remove the unmerged fields, especially with the MailMergeCleanupOptions.REMOVE_UNUSED_FIELDS. There are two reasons, one reason is we also provide the merged Word document to our customers. Removing the IF condition means a behavior change to our customer. The other reason is more critical, if there are unmerged fields outside of IF expression, we don’t know why it is not merged. In this situation, we would like to report an error to block generating the final PDF instead of removing those unmerged fields with REMOVE_UNUSED_FIELDS options. After we do some investigation to know the reason why the PDF is not generated, we can help customers to regenerated the PDF. Sending customers a PDF late is much better than sending them a wrong one.
As I explained in the previous post, our requirements are
For #1 scenario, we expect all the fields are merged no matter where they are located, so each field is validated with our predefined data;
For #2 scenario, we expect a way to get all the fields which need to be merged but not. namely, the fields that don’t meet IF condition should be excluded;
Are our use scenarios and requirements clear enough to you?
I understand your current IF behavior well, but we implemented our function based on Aspose.words heavily, I hope you could provide a solution to meet our requirements.
Any more question please let me know.