Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aspose-com-kb/738142a82986716a60f41799289ad605 to your computer and use it in GitHub Desktop.
Save aspose-com-kb/738142a82986716a60f41799289ad605 to your computer and use it in GitHub Desktop.
Code to Add Signature in PowerPoint using Java. For further details: https://kb.aspose.com/slides/java/how-to-add-signature-in-powerpoint-using-java/
import com.aspose.slides.DigitalSignature;
import com.aspose.slides.Presentation;
import com.aspose.slides.SaveFormat;
public class AsposeTest {
public static void main(String[] args) throws Exception {//Main function to add a signature to a presentation in Java
// Set the license
com.aspose.slides.License lic = new com.aspose.slides.License();
lic.setLicense("Aspose.Total.lic");
// Create a presentation
Presentation presentation = new Presentation();
// Load the PFX certificate by providing the password
DigitalSignature digitalSignature = new DigitalSignature("certificate.pfx", "mypass");
// Set the signature comments
digitalSignature.setComments("Test comments for the digital signature");
// Add the signature to the presentation
presentation.getDigitalSignatures().add(digitalSignature);
// Save the presentation
presentation.save("SignedPresentation.pptx", SaveFormat.Pptx);
System.out.println("Done");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment