![]()
Implementing a SecurityCallback
When the Document class encounters a PDF document that is encrypted with Acrobat standard security, it first tries to open the PDF file with an empty password string. If the Document class fails to validate the empty password, the application must have a mechanism to request the password. You can use the com.icesoft.pdf.SecurityCallback interface to do this.
The interface has one method, which is called by the Document class to retrieve a document's password. You can implement the SecurityCallback interface in numerous ways to meet the needs of your application. For example, the package com.icesoft.pdf.ri.common contains reference code for the SecurityCallback in the class MyGUISecurityCallback.
The following is an example of the necessary code needed to register MyGUISecurityCallback with the Document class:
Document document = new Document(); document.setSecurityCallback( new MyGUISecurityCallback(aJFrame, aResourceBundle) );
|
Copyright 2005-2007. ICEsoft Technologies, Inc. http://www.icesoft.com |