Skip to content

Instantly share code, notes, and snippets.

View aspose-com-kb's full-sized avatar

aspose-com-kb

View GitHub Profile
@aspose-com-kb
aspose-com-kb / Add JavaScript to PDF using Java.java
Created March 17, 2026 17:37
Add JavaScript to PDF using Java.
import com.aspose.pdf.Document;
import com.aspose.pdf.JavascriptAction;
public class AddJsToPdf
{
public static void main(String[] args) throws Exception
{
// Load Aspose license
com.aspose.pdf.License license = new com.aspose.pdf.License();
license.setLicense("license.lic");
import com.aspose.words.*;
public class AddSections {
public static void main(String[] args) throws Exception {
// Load license
License lic = new License();
lic.setLicense("license.lic");
// Create document + builder
Document doc = new Document();
using Aspose.Pdf;
using Aspose.Pdf.Annotations;
class Program
{
static void Main()
{
new License().SetLicense("license.lic");
// Load an existing PDF
import aspose.words as aw
def main():
license = aw.License()
license.set_license("license.lic")
signatures = aw.digitalsignatures.DigitalSignatureUtil.load_signatures("SignedFile.docx")
print(f"Signatures count before removing signatures = {signatures.count}")
aw.digitalsignatures.DigitalSignatureUtil.remove_all_signatures(
import com.aspose.words.DigitalSignatureCollection;
import com.aspose.words.DigitalSignatureUtil;
import com.aspose.words.License;
public class RemoveSignatures {
public static void main(String[] args) throws Exception {
License lic = new License();
lic.setLicense("license.lic");
DigitalSignatureCollection signatures = DigitalSignatureUtil.loadSignatures("SignedFile.docx");
using System.IO;
using Aspose.Words;
using Aspose.Words.DigitalSignatures;
namespace SignaturesRemovalDemo
{
class Program
{
static void Main(string[] args)
{
import aspose.words as aw
def main():
lic = aw.License()
lic.set_license("license.lic")
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
# Write some content
using Aspose.Words;
namespace AsposeWordsMdToDocxDemo
{
class Program
{
static void Main(string[] args)
{
License lic = new License();
lic.SetLicense("license.lic");
import base64
import aspose.words as aw
def main():
lic = aw.License()
lic.set_license("license.lic")
# Path to a signed Word file
file_path = "SignedOutput.docx"
# Check signature presence
import com.aspose.words.*;
public class WordFileSignatureDemo {
public static void main(String[] args) throws Exception {
License lic = new License();
lic.setLicense("license.lic");
// Path to a signed Word file
String filePath = "SignedOutput.docx";