Aspose.words合并多个word
1、下载的jar包,导⼊aspose.words依赖
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>15.8.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/aspose-words-15.8.0-jdk16.jar</systemPath>
</dependency>
2、去除⽔印
public boolean isLence() {
try {教师节祝福语 简短独特
InputStream is = ClassLoader()
.getResourceAsStream("l");
License aposeLic = new License();
aposeLic.setLicense(is);
return true;
} catch (Exception e) {
return false;
}
无上衣}
<License>
<Data>
<Products>
<Product>Aspose.Total for Java</Product>
<Product>Aspose.Words for Java</Product>
</Products>
<EditionType>Enterprise</EditionType>
<SubscriptionExpiry>20991231</SubscriptionExpiry>某年某月某天
<LicenseExpiry>20991231</LicenseExpiry>
<SerialNumber>23dcc79f-44ec-4a23-be3a-03c1632404e9</SerialNumber>
</Data>
高速收费标准<Signature>0nRuwNEddXwLfXB7pw66G71MS93gW8mNzJ7vuh3Sf4VAEOBfpxtHLCotymv1PoeukxYe31K441Ivq0Pkvx1yZZG4O1KCv3Omdbs7uqzUB4xXHlOub </License>
3、合并⽂档
陈每文if (!this.isLence()) {
throw new CustomException("去⽔印失败,请联系管理员");
}
try{
//将cs1.doc和cs2.doc合并到cs3.doc中
圣魔光石金手指Document doc1 = new Document("d:\cs1.doc");
Document doc2 = new Document("d:\cs2.doc");
Document doc3 = new Document();
FileOutputStream fos = new FileOutputStrem(new File("d:\cs3.doc"));
doc3.appendDocument(doc1,ImportFormatMode.USE_DESTINATION_STYLES); doc3.appendDocument(doc2,ImportFormatMode.USE_DESTINATION_STYLES); doc3.save(fos, SaveFormat.DOC);
}catch(Exception e){
throw new Message());
}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论