Solution of the Support request:
Following example code, shows how to clip a new document to a existing document in a file cabinet. The docid was used to fetch the documents. This procedure can be advanced to an unlimited amount of documents, by using a loop.
public static void ClipDocuments()
{
// Get id of existing document from filecabinet
FileCabinet fc = organization.GetFileCabinetsFromFilecabinetsRelation().FileCabinet.First(f => f.Id == fcid);
int doc1 = fc.GetDocumentsResult().Items.First(d => d.Id == docid).Id;
// Upload second doc and fetch docid
int doc2 = EasyUploadToFileCabinet(fc);
// ClipDocuments documents
List<int> docids = new List<int>()
{
doc1,
doc2,
};
Document mergedDocument = fc.PutToContentMergeOperationRelationForDocument
(
new ContentMergeOperationInfo()
{
Documents = docids,
Operation = ContentMergeOperation.Clip,
Force = true,
}
);
}
private static int EasyUploadToFileCabinet(FileCabinet fc)
{
var document = fc.EasyUploadSingleDocument(
new System.IO.FileInfo("C:/example.pdf"));
return document.Id;
}