ポリシーで保護されたドキュメントへの表紙の追加

ほとんどの Adobe 以外の PDF ビューアの場合、Rights Management で保護されたドキュメントを開くと、最初のページが空白ページとして表示されるか、アプリケーションがドキュメントを開かずに中止されます。

ページ 0(ラッパードキュメント)サポートを使用してアドビ以外の PDF ビューアで保護されたドキュメントを開き、ドキュメントの表紙を表示できます。

注意: Adobe Reader/Acrobat または Mobile Reader で(ページ 0 を含む)このようなドキュメントを表示する場合、デフォルトで保護されたドキュメントが開かれます。

ポリシーで保護されたドキュメントに表紙を追加するには

LiveCycle Workbench で次のプロセスを使用します。

表紙によるドキュメントの保護:
指定されたポリシーで PDF ドキュメントを保護し、表紙をドキュメントに追加します

保護されたドキュメントの抽出:
ポリシーで保護された PDF ドキュメントを表紙付きの PDF ドキュメントから抽出します

次の Rights Management API を使用します。

protectDocumentWithCoverPage:
特定の PDF を指定されたポリシーで保護し、表紙付きのドキュメントと保護されたドキュメントを添付ファイルとして返します
//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:
表紙付きのドキュメント内の添付ファイルである保護されたドキュメントを抽出します。表紙付きのドキュメントは protectDocumentWithCoverPage メソッドを使用して作成されます
//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);