// For complete examples and data files, please go to https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java
SignatureConfig signConfig = CommonUtilities.getConfiguration();
// instantiating the conversion handler
SignatureHandler<String> handler = new SignatureHandler<String>(signConfig);
//setup size and position
PdfSignImageOptions signOptions = new PdfSignImageOptions(CommonUtilities.getImagesPath("sign.png"));
signOptions.setLeft(100);
signOptions.setTop(100);
signOptions.setWidth(200);
signOptions.setHeight(200);
// setup rotation
signOptions.setRotationAngle(48);
//setup additional image appearance
ImageAppearance imageAppearance = new ImageAppearance();
imageAppearance.setBrightness(1.2f);
imageAppearance.setGrayscale(true);
imageAppearance.setBorderDashStyle(ExtendedDashStyle.Dot);
imageAppearance.setBorderColor(Color.ORANGE);
imageAppearance.setBorderWeight(5);
signOptions.setAppearance(imageAppearance);
final SaveOptions saveOptions = new SaveOptions();
saveOptions.setOutputType(OutputType.String);
saveOptions.setOutputFileName("signed_output");
String signedPath = handler.sign(CommonUtilities.getStoragePath(fileName), signOptions, saveOptions);
System.out.println("Signed file path is: " + signedPath);