Hi!
I must create a new document (doc) with first version from source document. The source document have several versions. New doc must have only one version with content from source. Content is PDF.
Next Javascrip code create a doc, but as expected binary content copyes as string.
var versionHistory = document.getVersionHistory();
var workFolder = companyhome.childByNamePath("Sites/swsdp/documentLibrary/test");
var doc = workFolder.createFile("new_copy_1.pdf");
doc.addAspect('cm:versionable');
doc.content = versionHistory[versionHistory.length-1].getNode().content;
doc.save();How to copy binary content in Javascript?
Thanks for your help, peace,
Serge