I used Aspose.Words for .Net 16.12.0 or 16.11.0,There are still the same problem.
Today I downloaded and used Aspose.Words for .Java 16.12.0,The same problems have emerged ?
This problem occurs only when using word 2003, Word 2007 or above is normal
The following is my Java code:
//
\* 获取license
\*
\* @return
\*//
public static boolean getLicense()
{
boolean result = false;
try
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
license = new FileInputStream(loader.getResource("license.xml").getPath());// 凭证文件
fileInput = new FileInputStream(loader.getResource("old.doc").getPath());// 待处理的文件
outputFile = new File("D:\new.doc");// 输出路径
//License asposeLic = new License();
//asposeLic.setLicense(license);
result = true;
}
catch (Exception e)
{
e.printStackTrace();
}
return result;
}
/
\*
\* @param args
\*/
public static void main(String[] args)
{
// 验证License
if (!getLicense())
{
return;
}
try
{
long old = System.currentTimeMillis();
Document doc = new Document(fileInput);
FileOutputStream fileOS = new FileOutputStream(outputFile);
doc.save(fileOS, SaveFormat.DOC);
long now = System.currentTimeMillis();
System.out.println("共耗时:" + ((now - old) / 1000.0) + "秒\n\n" + "文件保存在:" + outputFile.getPath());
}
catch (Exception e)
{
e.printStackTrace();
}
}
}