Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Sat Jul 20, 2024 5:12 am

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!");

}
}

cuongtsm1987
 
Posts: 1
Joined: Sun Jun 23, 2024 10:38 am

Mon Jul 22, 2024 8:02 am

Hello,

Thank you for your inquiry. The Spire Doc 5.2 you are using is our free version, the free version is limited to 500 paragraphs and 25 tables. If the content of your document exceeds these limits, the header and footer content may not be loaded. In your case, we suggest using our latest commercial version (Spire.Doc for Java Version: 12.7.6) to test. We can provide you with a temporary one-month license for testing. If you need it, please feel free to reply to us.

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 306
Joined: Mon Jul 15, 2024 5:40 am

Return to Spire.Doc

cron