In the case of most non-Adobe PDF viewers, if you open
a Rights Management protected document either the first page is
displayed as a blank page or the application aborts without opening
the document.
You can use the Page 0 (Wrapper Document) support to allow non-Adobe
PDF viewers to open a protected document and display a cover page
in the document.
Note: When viewing such documents (containing a Page 0) in Adobe Reader/Acrobat
or Mobile Reader, the protected document is opened by default.
To add cover page to a policy protected documentUse
the following processes in LiveCycle Workbench:
- Protect Document With Cover Page:
- Secures a PDF document with the specified policy, and adds
a cover page to the document
- Extract Protected Document:
- Extracts the policy-protected PDF document from the PDF document
with cover page
Use the following Rights
Management APIs:
- protectDocumentWithCoverPage:
- Secures a given PDF with the specified policy, and returns
a document with a cover page and the protected document as an attachment
//Create a ServiceClientFactory instance
ServiceClientFactory factory = ServiceClientFactory.createInstance(connectionProps);
//Create a RightsManagementClient object
RightsManagementClient rightsClient = new RightsManagementClient(factory);
//Reference a PDF document to which a policy is applied
FileInputStream fileInputStream = new FileInputStream("C:\\testFile.pdf");
Document inPDF = new Document(fileInputStream);
//Reference a Cover Page document
FileInputStream coverPageInputStream = new FileInputStream("C:\\CoverPage.pdf");
Document inCoverDoc = new Document(coverPageInputStream);
//Create a Document Manager object
DocumentManager documentManager = rightsClient.getDocumentManager();
//Apply a policy to the PDF document
RMSecureDocumentResult rmSecureDocument = documentManager.protectDocumentWithCoverPage(
inPDF,
"ProtectedPDF.pdf",
"PolicySetName",
"PolicyName",
null,
null,
inCoverDoc,
true);
//Retrieve the policy-protected PDF document
Document protectPDF = rmSecureDocument.getProtectedDoc();
//Save the policy-protected PDF document
File myFile = new File("C:\\PolicyProtectedDoc.pdf");
protectPDF.copyToFile(myFile);
- extractProtectedDocument:
- Extracts the protected document which is an attachment in
the document with cover page. The document with the cover page can
be created using protectDocumentWithCoverPage method
//Create a ServiceClientFactory instance
ServiceClientFactory factory = ServiceClientFactory.createInstance(connectionProps);
//Create a RightsManagementClient object
RightsManagementClient rightsClient = new RightsManagementClient(factory);
//Reference a protected PDF document with a Cover Page
FileInputStream fileInputStream = new FileInputStream("C:\\policyProtectedDocWithCoverPage.pdf");
Document inPDF = new Document(fileInputStream);
//Create a Document Manager object
DocumentManager documentManager = rightsClient.getDocumentManager();
//Apply a policy to the PDF document
Document extractedDoc = documentManager.extractProtectedDocument(inPDF);
//Save the policy-protected PDF document
File myFile = new File("C:\\PolicyProtectedDoc.pdf");
extractedDoc.copyToFile(myFile);
|
|
|