How get the file transition, if I know the id Object father…
hello
I programmed in C# CTS, and I want to get the pdf document transformed
the code is as follows....
Code |
---|
static void Main(string[] args) try objectService = serviceFactory.GetRemoteService<IObjectService>(
string TransformedId = TransformationToPDF(documentumId); Console.WriteLine("Proceso terminado...."); byte[] data = driver.GetFileToDocumentum(TransformedId); using (Stream s = File.Create(@c:\download.pdf))
Console.Read("Proceso terminado...."); } public string TransformationToPDF(string documentumId) ObjectIdentity jobId = null;
jobTicket.sourceObjectId = documentumId; jobTicket.Profile = profileService.GetProfileByName(_repository, "optimizePDF_adts"); jobTicket.Profile.Parameters[0].name = "doc_token_PrintType";//"doc_token_f_textCenter"; jobTicket.Profile.Parameters[1].name = "doc_token_NoteIcons"; jobTicket.ParamProperties = jobTicket.Profile.Parameters; jobTicket.renditionName = "Nombre del Rendition"; jobTicket.isStoreResultInRepo = false; jobId = transformationService.AddJob(jobTicket); return ((ObjectId)jobId.Value).Id public byte[] GetFileToDocumentum(string documentumId) try dataObject = dataPackage.DataObjects[0]; contentObj = dataObject.Contents[0]; return contentObj.GetAsByteArray(); ObjectIdentitySet objectIdentitySet = new ObjectIdentitySet(); DataPackage dataPackage = null; try PermissionProfile permissionProfile = new PermissionProfile(); contentTransferProfile.TransferMode = ContentTransferMode.MTOM; dataPackage = objectService.Get(objectIdentitySet, operationOptions); return dataPackage; |
when opening the file, I mark the following error....
Adobe Reader could not open 'archivo.pdf' because it is either not a supported file type or because the file has been damaged (for example, ir was sent as an email attachment and wasn't correctly decoded).
the error is due to format
original format is XML, not pdf
inside the file xml, a node named target_object_id, contains a id, but I do not it is the correct object...
thanks I hope help me....
Comments
Categories
- All Categories
- 108 Developer Announcements
- 53 Articles
- 106 General Questions
- 144 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 899 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 120 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management