Hello everyone,
i´m using LC Rightsmanagement to apply policies to pdf documents. It
works fine but applying a policy to a 120 MB file takes more than four
minutes. Here is some example code
>Properties connectionProps = new Properties();
>connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT,"jnp://localhost:1099");
>connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);
>connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE,"JBoss");
>connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME,"administrator");
>connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD,"password");
>// Create a ServiceClientFactory instance
>ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
>// Specify the PDF document to encrypt with a password
>FileInputStream fileInputStream = new FileInputStream("c:\\TMP\\large.pdf");
>Document inDoc = new Document(fileInputStream);
>RightsManagementClient c = new RightsManagementClient(myFactory);
>Document protected = c.getDocumentManager().applyPolicy(inDoc, "large", "Policy Set", "Policy", "Domain", "user");
>File myFile = new File("c:\\TMP\\large_protected.pdf");
>protected.copyToFile(myFile);
The last statement "protected.copyToFile(myFile)" takes most time (up
to 4 minutes). Watching the network shows a lot of traffic, so i think
the protected content is streamed via network.
If i use acrobat pro to apply the policy it only needs a few seconds
till the jobs done, so i think that there must be a much faster way to
apply a policy to a document.
Does anyone know about this problem?
thx
rijn