|
|
The following C# code example retrieves information about the credential that is used to apply usage-rights to a rights-enabled PDF document named UsageRightsLoan.pdf.using System;using System.Collections;using System.ComponentModel;using System.Data;using System.IO ;namespace RetrieveCredentialInformation{class Class1{[STAThread]static void Main(string[] args){try{//Create a ReaderExtensionsServiceService client objectReaderExtensionsServiceService readerExClient = new ReaderExtensionsServiceService();readerExClient.Credentials = new System.Net.NetworkCredential("administrator", "password");//Create a BLOB to store a rights-enabled PDF documentBLOB inDoc = new BLOB();//Specify a rights-enabled PDF documentstring path = "C:\\Adobe\\UsageRightsLoan.pdf";FileStream fs = new FileStream(path, FileMode.Open);//Get the length of the file streamint len = (int)fs.Length;byte[] ByteArray=new byte[len];//Populate the byte array with the contents of the FileStream objectfs.Read(ByteArray, 0, len);inDoc.binaryData = ByteArray;//Retrieve credential informationGetUsageRightsResult usageRightsResult = readerExClient.getDocumentUsageRights(inDoc);//Get the date after which the credential is no longer validDateTime endDate = usageRightsResult.notAfter;//Get the message that is displayed in Adobe Reader when the//rights-enabled document is openedstring message = usageRightsResult.message;//Get usage rights to see if the enableFormFillIn is enabledUsageRights myRight = usageRightsResult.rights;bool ans = myRight.enabledFormFillIn ;if (ans == true)Console.WriteLine("The enableFormFillIn usage right is enabled");elseConsole.WriteLine("The enableFormFillIn usage right is not enabled");}catch (Exception ee){Console.WriteLine(ee.Message);}}}}
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/quickStarts_ReaderExtensions.14.8.html