on 07-19-2013 3:37 PM
Hi Experts,
We are trying to generate automatically a new version of a contract document, but this new version must be in PDF format. The script needs to identify the last version of this contract document and convert it in a PDF file, adding this new file (PDF) as new version.
We found a JAVA method to generate a PDF file using a DOCX file, but don’t know what to do to make this process work completely in CLM.
Appreciate any help on this.
Thanks,
Adilson
Hi Adilson,
You can follow the link below to get the file attachment from CLM:
http://scn.sap.com/message/13834923#13834923
Once you have the file attachement as java.io.File, use the java method that you found to convert it into pdf format.
Now create an attachment using TypeFactory
TypeFactory.createAttachment();
This creates an empty attachment. Set data to this attachment using the following method:
setFileData(java.lang.String aDisplayName, java.io.InputStream aBytes, ParentObjectReferenceIfc parentRef, IapiSessionContextIfc session)
The second parameter in the above method is obtained by opening an inputstream on the pdf file generated.
Since you want to add the pdf file as a new version, add it using this method:
setDoc(AttachmentIfc value)
// method on DocumentVersionIBeanIfc
Hope this helps.
-
Bindu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.