@pdftron/pdfnet-node-samples 10.11.0 → 10.12.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -430,11 +430,11 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
430
430
  console.log('================================================================================');
431
431
  };
432
432
 
433
- const TimestampAndEnableLTV = async (in_docpath, in_trusted_cert_path, in_appearance_img_path, in_outpath) => {
433
+ const TimestampAndEnableLTV = async (in_docpath, in_tsa_url, in_trusted_cert_path, in_appearance_img_path, in_outpath) => {
434
434
  const doc = await PDFNet.PDFDoc.createFromFilePath(in_docpath);
435
435
  doc.initSecurityHandler();
436
436
  const doctimestamp_signature_field = await doc.createDigitalSignatureField();
437
- const tst_config = await PDFNet.TimestampingConfiguration.createFromURL('http://rfc3161timestamp.globalsign.com/advanced');
437
+ const tst_config = await PDFNet.TimestampingConfiguration.createFromURL(in_tsa_url);
438
438
  const opts = await PDFNet.VerificationOptions.create(PDFNet.VerificationOptions.SecurityLevel.e_compatibility_and_archiving);
439
439
  /* It is necessary to add to the VerificationOptions a trusted root certificate corresponding to
440
440
  the chain used by the timestamp authority to sign the timestamp token, in order for the timestamp
@@ -592,8 +592,27 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
592
592
 
593
593
  //////////////////// TEST 7: Timestamp a document, then add Long Term Validation (LTV) information for the DocTimeStamp.
594
594
  // try {
595
+ // // Replace YOUR_URL_OF_TSA with the timestamp authority (TSA) URL to use during timestamping.
596
+ // // For example, as of July 2024, http://timestamp.globalsign.com/tsa/r6advanced1 was usable.
597
+ // // Note that this url may not work in the future. A reliable solution requires using your own TSA.
598
+ // const tsa_url = 'YOUR_URL_OF_TSA';
599
+ // if (tsa_url == 'YOUR_URL_OF_TSA')
600
+ // {
601
+ // throw new Error('The URL of your timestamp authority was not specified.');
602
+ // }
603
+ //
604
+ // // Replace YOUR_CERTIFICATE with the trusted root certificate corresponding to the chain used by the timestamp authority.
605
+ // // For example, as of July 2024, https://secure.globalsign.com/cacert/gstsacasha384g4.crt was usable.
606
+ // // Note that this certificate may not work in the future. A reliable solution requires using your own TSA certificate.
607
+ // const trusted_cert_path = 'YOUR_CERTIFICATE';
608
+ // if (trusted_cert_path == 'YOUR_CERTIFICATE')
609
+ // {
610
+ // throw new Error('The path to your timestamp authority trusted root certificate was not specified.');
611
+ // }
612
+ //
595
613
  // if (!(await TimestampAndEnableLTV(input_path + 'waiver.pdf',
596
- // input_path + 'GlobalSignRootForTST.cer',
614
+ // tsa_url,
615
+ // trusted_cert_path,
597
616
  // input_path + 'signature.jpg',
598
617
  // output_path + 'waiver_DocTimeStamp_LTV.pdf'))) {
599
618
  // ret = 1;
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdftron/pdfnet-node-samples",
3
- "version": "10.11.0",
3
+ "version": "10.12.0-beta",
4
4
  "description": "Sample code for the @pdftron/pdfnet-node package.",
5
5
  "scripts": {
6
6
  "test": "run-script-os",
@@ -12,7 +12,7 @@
12
12
  "license": "Commercial",
13
13
  "homepage": "https://www.pdftron.com",
14
14
  "dependencies": {
15
- "@pdftron/pdfnet-node": "^10.11.0",
15
+ "@pdftron/pdfnet-node": "^10.12.0-beta",
16
16
  "run-script-os": "^1.1.6",
17
17
  "underscore": "^1.13.6",
18
18
  "xhr2": "^0.2.1"
package/readme.md CHANGED
@@ -6,7 +6,7 @@ This package leverages the full power of Apryse's native SDK for maximal perform
6
6
  This package depends on unmanaged add-on binaries, and the add-on binaries are not cross-platform. At the moment we have support for
7
7
  * **OS**: Linux (excluding Alpine), Windows(x64), Mac
8
8
  * **Node.js version**: 8 - 22
9
- * **Electron version**: 6 - 30
9
+ * **Electron version**: 30 - 30
10
10
 
11
11
  Installation will fail if your OS, Node.js or Electron version is not supported.
12
12
 
Binary file