Hi,
I need to put an image and some text in the footer. It should be different on each page so I decided to use IF FIELD to steer the visibility.
Everything works fine when I save document in DOC format, but it doesn’t work while saving to PDF.
Here is sample code to reproduce this case (sample document ‘test.doc’ in attachment):
Document document = new Document("c:\test.doc");
DocumentBuilder db = new DocumentBuilder(document);
db.moveToBookmark("bookmark");
FieldStart start = db.insertField("IF "", null);
db.moveTo(start.getNextSibling().getNextSibling());
db.insertField("PAGE", null);
db.write("" = "1" "sample text on page 1" "sample text on page 2"");
document.save("C:\test_output.doc");
document.saveToPdf("c:\test_output.pdf");