After running this code, all of my header and footer are gone. Please help me to solve the problem, thanks
The project is running on jdk 17, spire doc 5.2
import com.spire.doc.Document;
import com.spire.doc.FileFormat;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
// Create a Document class instance
Document document = new Document();
document.loadFromFile("D:\\template-bctdl.docx", FileFormat.Auto);
//System.out.println("Bắt đầu!");
document.replace("cuongtsm", "tsmc", false, true);
document.saveToFile("D:\\Vltn.docx", FileFormat.Auto);
//System.out.println("Đỏn!");
}
}