我想编写一个Java代码,用于将文档的内容从MS-word文件更新为IBM Filenet Content Engine 4.5中的pdf文件。现在不需要转换,只需更新内容。元文件属性等在word文件中保持不变。
非常感谢
答案 0 :(得分:0)
使用文档中的代码示例是否有任何问题?
基于Setting a Document's Content:
// references to the document and file you are working with
Document document;
File file;
document.checkout(ReservationType.EXCLUSIVE, null, null, null);
document.save(RefreshMode.REFRESH);
Document reservation = (Document) document.get_Reservation();
ContentTransfer contentTransfer = Factory.ContentTransfer.createInstance();
InputStream inputStream = new FileInputStream(file);
ContentElementList contentList = Factory.ContentTransfer.createList();
contentTransfer.setCaptureSource(inputStream);
contentList.add(contentTransfer);
reservation.set_ContentElements(contentList);
reservation.save(RefreshMode.REFRESH);
reservation.checkin(AutoClassify.DO_NOT_AUTO_CLASSIFY, CheckinType.MAJOR_VERSION);
reservation.save(RefreshMode.REFRESH);