Last active
October 17, 2022 15:18
-
-
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/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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