I'm new to Spire.Doc and we are thinking about migrating from Aspose. But I have encountered an issue, which is crucial for us.
I have attached a sample template so you can recreate the issue:
What we want to achieve is to have complex IF merge tags, e.g.
- Code: Select all
{IF {mergefiel} = "True" "output a layouted table with other mergefields inside" ""}
There also seems to be some kind of bug even with just some multiline output, e.g.
- Code: Select all
{IF {mergefiel} = "True" "output a multiline text" ""}
Here is the sample code:
- Code: Select all
Document document = new Document();
document.LoadFromFile(@"test.docx");
string[] fieldNames = { "Amount_open__c", "Insured_By_Heidelpay__c", "Invoice_Number__c" };
string[] fieldValues { "101,75", "False", "i97807-Test" };
document.MailMerge.ClearFields = true;
document.MailMerge.HideEmptyParagraphs = true;
document.MailMerge.Execute(fieldNames, fieldValues);
document.SaveToFile("test.pdf", FileFormat.PDF);
And not related, but also a support question: Are \b and \f switches like {MERGEFIELD field \b "some text: "} allowed in the mergefield? In my tests it didn't work.