GroupDocsGists
10/24/2017 - 8:20 AM

signSlidesDocWithStampSignature.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 options
SlidesStampSignOptions signOptions = new SlidesStampSignOptions();
signOptions.setHeight(200);
signOptions.setWidth(400);

//Outer round lines
StampLine line0 = new StampLine();
line0.setText(" * John * Smith  * John * Smith  * John * Smith  * John * Smith  * John * Smith * John * Smith *  John * Smith * ");
line0.getFont().setFontSize(12);
line0.setHeight(22);
line0.setTextBottomIntent(6);
line0.setTextColor(Color.LIGHT_GRAY);
line0.setBackgroundColor(Color.BLUE);
signOptions.getOuterLines().add(line0);

//Inner square lines
StampLine line1 = new StampLine();
line1.setText("John Smith");
line1.setTextColor(Color.MAGENTA);
line1.getFont().setFontSize(24);
line1.getFont().setBold(true);
line1.setHeight(100);
signOptions.getInnerLines().add(line1);

// if you need to sign all sheets set it to true
signOptions.setSignAllPages(true);
signOptions.setOpacity(0.8);

SaveOptions saveOptions =  new SaveOptions();
saveOptions.setOutputType(OutputType.String);
saveOptions.setOutputFileName("signed_output");

// sign document
String signedPath = handler.<String>sign(fileName, signOptions, saveOptions);
System.out.println("Signed file path is: "+signedPath);