Hi,
I’m not able to read the IF conditional merge fields.
I want to read and hold and display like other merge fields.
in the template I provided {GENDER} in IF condition. this i want to read.
The code is below specified, and please find the template file attached.
for this program the output is like below specified.
public class ReadMergeFields1 {
public static void main(String[] args) throws Exception {
String dataDir = "H:\\mytickets\\AsposePoc\\src\\main\\resources\\SmartMarkers\\";
Document doc = new Document(dataDir + "in_Nested.docx");
//String f = doc.getMailMerge().getRegionsHierarchy().getName();
doc.getMailMerge().setUseNonMergeFields(true);
String f1[] = doc.getMailMerge().getFieldNames();
for (String f : f1) {
System.out.println(f);
}
System.out.println("done");
}
}
OUTPUT:
TableStart:investorTable
investorDocumentList
TableEnd:investorTable
TableStart:ipartyTable
partyName
TableStart:ipartyChildTable
documentList
TableEnd:ipartyChildTable
TableEnd:ipartyTable
NAME
SALARY
in_Nested.docx (18.8 KB)