{
usage();
}
else
{
AccessPermission ap = new AccessPermission();
String infile = null;
String outfile = null;
String certFile = null;
String userPassword = "";
String ownerPassword = "";
int keyLength = 40;
PDDocument document = null;
try
{
for( int i=0; i<args.length; i++ )
{
String key = args[i];
if( key.equals( "-O" ) )
{
ownerPassword = args[++i];
}
else if( key.equals( "-U" ) )
{
userPassword = args[++i];
}
else if( key.equals( "-canAssemble" ) )
{
ap.setCanAssembleDocument(args[++i].equalsIgnoreCase( "true" ));
}
else if( key.equals( "-canExtractContent" ) )
{
ap.setCanExtractContent( args[++i].equalsIgnoreCase( "true" ) );
}
else if( key.equals( "-canExtractForAccessibility" ) )
{
ap.setCanExtractForAccessibility( args[++i].equalsIgnoreCase( "true" ) );
}
else if( key.equals( "-canFillInForm" ) )
{
ap.setCanFillInForm( args[++i].equalsIgnoreCase( "true" ) );
}
else if( key.equals( "-canModify" ) )
{
ap.setCanModify( args[++i].equalsIgnoreCase( "true" ) );
}
else if( key.equals( "-canModifyAnnotations" ) )
{
ap.setCanModifyAnnotations( args[++i].equalsIgnoreCase( "true" ) );
}
else if( key.equals( "-canPrint" ) )
{
ap.setCanPrint( args[++i].equalsIgnoreCase( "true" ) );
}
else if( key.equals( "-canPrintDegraded" ) )
{
ap.setCanPrintDegraded( args[++i].equalsIgnoreCase( "true" ) );
}
else if( key.equals( "-certFile" ) )
{
certFile = args[++i];
}