1

I want to write a Java code which update a document's content from a MS-word file to a pdf file in IBM Filenet Content Engine 4.5.No conversion as of now required, just updation of the content only. Metadata Properties etc remain unchanged from the word file.

Many Thanks

  • I am not clear on what you are asking, however you can use IBM Content Navigator for Microsoft Office. in which you can integrate IBM Content Navigator features, like searching, browsing, and checking documents in and out of the repository, with Microsoft Office Word. – WiredCoder Jul 02 '16 at 13:18
  • Adding to my answer above, you can use the IBM rendition engine to convert your updated word document later on to a PDF document that will hold the same properties and the same security template – WiredCoder Jul 02 '16 at 13:23
  • If you are using Content Navigator (2.x/3.x), you can always download the .doc/.docx files as PDF in FileNet P8 up until - 5.5.3. – Ajay Kumar Jul 07 '20 at 21:09

1 Answers1

1

Do you have any problem using code samples from the documentation?

Based on 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);
ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
  • Hi fnt, yes I tried the code samples but in there it is asking for a file read and input from the outside local directory and when I did that, the document was having both the new as well as old content.What I'm looking for is to remove the old content (msword doc) entirely and then add new document(pdf) as a major version. – prodigalien Nov 11 '13 at 08:51
  • why do you want to delete the old MS-Word, dont want to keep it as a superseeded version? Post what have you tried – icrovett Nov 11 '13 at 09:28
  • @user2977855 You can delete previous version simply by fetching it by its ID and then deleting it - http://pic.dhe.ibm.com/infocenter/p8docs/v5r1m0/topic/com.ibm.p8.ce.dev.ce.doc/document_procedures.htm?path=11_2_3_10_1_4#doc_procedures_delete – ᄂ ᄀ Nov 11 '13 at 17:59