1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| import com.lexpersona.lp7command.command.CommandException;
import com.lexpersona.lp7command.command.LP7Command;
public class SignExpert {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
System.out.println("Test");
String TblCommand[] = new String[22];
TblCommand[0]="-create";
TblCommand[1]="-sourcefile";
TblCommand[2]="C:\\Users\\cyril\\Desktop\\SignatureJava\\test.pdf";
TblCommand[3]="-signaturetype";
TblCommand[4]="-independant--implicit";
TblCommand[5]="-keystoretype";
TblCommand[6]="pkcs11";
TblCommand[7]="-token_manager_invisible";
TblCommand[8]="-token_pkcs11_module gclib.dll";
TblCommand[9]="-token_manager_invisible";
TblCommand[10]="-format plp7";
TblCommand[11]="-pdf-image-file";
TblCommand[12]="C:\\Users\\cyril\\Desktop\\SignatureJava\\signature.jpg";
TblCommand[13]="-pdf-pages period 2;1";
TblCommand[14]="-pdf-image-position bottom-left;20";
TblCommand[15]="-visible_signature";
TblCommand[16]="-visible_signature_image";
TblCommand[17]="C:\\Users\\cyril\\Desktop\\SignatureJava\\signature.jpg";
TblCommand[18]="-visible_signature_page 1";
TblCommand[19]="-visible_signature_width 80";
TblCommand[20]="-visible_signature_height 40";
TblCommand[21]="-visible_signature_position bottom-right;30";
LP7Command command = new LP7Command();
command.decodeParameters(TblCommand);
command.process();
}
catch (CommandException exception) {
int errorCode = exception.getCode();
System.out.println("Error code: " + errorCode);
System.out.println("Error message: ");
exception.printStackTrace(System.out);
}
}
} |