GroupDocsGists
10/24/2017 - 8:23 AM

addTransperanceAndRotationToTextSignatureAppearance.java

// For complete examples and data files, please go to https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java
// setup Signature configuration 
SignatureConfig signConfig = CommonUtilities.getConfiguration(); 
// instantiating the conversion handler
SignatureHandler<String> handler = new SignatureHandler<String>(signConfig);
// setup appearance options
SlidesSignTextOptions signOptions = new SlidesSignTextOptions("John Smith");
signOptions.setLeft(100);
signOptions.setTop(100);
signOptions.setWidth(200);
signOptions.setHeight(200);
signOptions.setForeColor(Color.ORANGE);
signOptions.setBackgroundColor(Color.BLUE);
signOptions.setBorderColor(Color.ORANGE);
signOptions.setBorderWeight(5);
// setup rotation
signOptions.setRotationAngle(48);
// setup transparency
signOptions.setBackgroundTransparency(0.4);
signOptions.setBorderTransparency(0.8);
final SaveOptions saveOptions = new SaveOptions();
saveOptions.setOutputType(OutputType.String);
saveOptions.setOutputFileName("signed_output");
// sign document
String signedPath = handler.sign(CommonUtilities.getStoragePath(fileName), signOptions, saveOptions);
System.out.println("Signed file path is: " + signedPath);