I have multiple documents being merged together. Some of these documents have footers with {Page} on them. I add a footer to all pages in the final document. Unfortunately because of the other {Page} tag in all the different document all the page number in the final footer that I add are wrong. Is there a way that adding my last footer to the document will keep one paging scheme while each document within will keep there own?
Or is there a way to simply keep my paging scheme and not reset the page count?
Hi
Thanks for your request and accept my apologizes for the delayed response. You can use code like the following to insert nested fields.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert the first part of the IF field
Field field = builder.insertField("IF \"");
// Move DocumentBuilder cursor to the next run after field start.
builder.moveTo(field.getStart().getNextSibling().getNextSibling());
// Insert MERGEFIELD field.
builder.insertField("MERGEFIELD Gender");
// Insert operator and field code if IF field.
builder.write("\" = \"Male\" \"Mr\" \"Mrs\"");
// Move cursor outside the field.
builder.moveToField(field, true);
// Insert some content after the IF field.
builder.write("Text after the IF field");
doc.save("C:\\Temp\\out.doc");