PDF’in şifresini JavaScript aracılığıyla çözün

JavaScript kullanarak Aspose.PDF Kütüphanesi ile PDF Dosyalarının kilidini açın.

JavaScript Kullanarak PDF Belgesinin Şifresini Çöz

PDF dosyasının şifresini çözmek için nodejs-cpp platformu için zengin özelliklere sahip, güçlü ve kullanımı kolay bir belge işleme API’si olan .NET için Aspose.PDF API’sini kullanacağız. NuGet paket yöneticisini açın, Aspose.PDF öğesini arayın ve yükleyin. Paket Yöneticisi Konsolu’ndan aşağıdaki komutu da kullanabilirsiniz.

JavaScript aracılığıyla PDF şifresini çözme


Ortamınızdaki kodu denemek için Aspose.PDF library gerekir.

<% decrypt.json-ld-nodejs.text %>

<% decrypt.code-block.text %>

PDF Belgesinin Şifresini Çözün - JavaScript.

Bu örnek kod, PDF dosyasının şifresinin nasıl çözüleceğini gösterir - JavaScript

Input file:

File not added

Password:

Output format:

Output file:

const AsposePdf = require('../AsposePDFforNode.js');
const pdf_encrypt_file = './ResultEncrypt.pdf';
AsposePdf().then(AsposePdfModule => {
    /*Decrypt a PDF-file with password is "owner" and save the "ResultDecrypt.pdf"*/
    const json = AsposePdfModule.AsposePdfDecrypt(pdf_encrypt_file, "owner", "./ResultDecrypt.pdf");
    console.log("AsposePdfDecrypt => %O", json.errorCode == 0 ? json.fileNameResult : json.errorText);
});