1- PdfReader::PdfReader(....., int [] purpose) throw UserPermissionException 
   In this new constructor the user will pass the permissions he/she want to 
perform.  PDF Reader will verify if the document has respective permission as 
it is doing now in "isOpenedWithFullPermissions".

2- PdfReader::isOpenWithUserPermissions( )
   This new method will assist  PdfStamperImp to verify the permissions during 
construction.

3- PdfReader::int [] permissionAsked // variable to cache permissions that user 
asked.

4: PdfStamperImp::PdfStamperImp
      if (  !reader.isOpenedWithFullPermissions()  )
             if (! isOpenWithUserPermissions()
                        throw new BadPasswordException("PdfReader not opened 
with owner password or user permissions")

this int array can be replace with single int where user can pass value after 
AND or OR operation.

After theses change the client code may be look like this.

try
{
      PdfReader reader = new PdfReader(filename);
     int[] purpose ={PdfReader.PRINTING, PdfReader.FILLING_FORM}

     stamp = new PdfStamper(pdfReader, output, '\0', false, purpose )
...........
}
catch(UserPermissionException e)
{
}

--
This message was sent on behalf of [email protected] at openSubscriber.com
http://www.opensubscriber.com/message/[email protected]/12662949.html

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to