Hi All,
I need some help here. I am new to use DFC for .Net. For my project I am downloading PDF rendition of a document. The problem is that while downloading I am getting the latest version of the document even if it is draft. Business user wants to download the last approved version of the document.
Say for example V 9.12 is my latest draft version and V 9 is my last appved version. I want to download version 9 instead of 9.12. Currently I am getting 9.12.
Thanks in Advance.
Here is my sample code.
ObjectId objectId = new ObjectId(objId); //my r_object_id
ObjectIdentity objIdentity = new ObjectIdentity(objectId, DefaultRepository);
List<ObjectIdentity> objeidentitycoll = new List<ObjectIdentity>();
objeidentitycoll.Add(objIdentity);
ObjectIdentitySet objectIdentitySet = new ObjectIdentitySet();
objectIdentitySet.Identities = objeidentitycoll;
ContentProfile contentProfile = new ContentProfile();
contentProfile.Format = "pdf";
contentProfile.FormatFilter = FormatFilter.SPECIFIED;
OperationOptions operationOptions = new OperationOptions();
operationOptions.ContentProfile = contentProfile;
operationOptions.SetProfile(contentProfile);
DataPackage dataPackage = objSvc.Get(objectIdentitySet, operationOptions);
Emc.Documentum.FS.DataModel.Core.DataObject dataObject = dataPackage.DataObjects[0];
if (dataObject.Contents.Count > 0)
{
return dataObject.Contents[0].GetAsByteArray();
}
else
{
return null;
}