Skip navigation links

Oracle BI Publisher Java API Reference
Release 5.6.3


oracle.apps.xdo.common.pdf.util
Class PDFSecurityUtil

java.lang.Object
  extended byoracle.apps.xdo.common.pdf.util.PDFSecurityUtil


public class PDFSecurityUtil
extends java.lang.Object

This class provides API for encryption and decryption of PDF.


Field Summary
static java.lang.String RCS_ID
           
static boolean RCS_ID_RECORDED
           

 

Constructor Summary
PDFSecurityUtil(java.io.InputStream inStream, java.io.OutputStream outStream)
           
PDFSecurityUtil(java.lang.String inPDF, java.lang.String outPDF)
           

 

Method Summary
 boolean decrypt(java.lang.String userPW, java.lang.String ownerPW)
          If the input PDF is encrypted, the decrypted PDF will be generated.
 boolean encrypt(java.util.Properties props)
          Encrypts PDF document with password protection.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values

RCS_ID_RECORDED

public static final boolean RCS_ID_RECORDED

Constructor Detail

PDFSecurityUtil

public PDFSecurityUtil(java.lang.String inPDF,
                       java.lang.String outPDF)
                throws java.io.IOException

PDFSecurityUtil

public PDFSecurityUtil(java.io.InputStream inStream,
                       java.io.OutputStream outStream)

Method Detail

encrypt

public boolean encrypt(java.util.Properties props)
Encrypts PDF document with password protection.
The following shows how to use.
 PDFSecurityUtil pdfSecurityUtil = new PDFSecurityUtil(inPDF , outPDF);
 Properties props = new properties();
 props.put("pdf-security", "true");
 props.put("pdf-open-password", "");
 props.put("pdf-permissions-password", "admin");
 pdfSecurityUtil.encrypt(props);
 
Please refer to XML Publisher's 5.6.2 User's Guide for the complete property list.
Parameters:
props -

decrypt

public boolean decrypt(java.lang.String userPW,
                       java.lang.String ownerPW)
If the input PDF is encrypted, the decrypted PDF will be generated. If either userPW or ownerPW is not correct, the output won't be generated even if the input PDF is encrypted properly.
Parameters:
ownerPW - a password to open a PDF
userPW - a password to decrypted a PDF
Returns:
true if PDF document is decrypted and generated properly.

Skip navigation links

Oracle BI Publisher Java API Reference
Release 5.6.3


© 2004, 2005, 2006, 2007, Oracle. All rights reserved.