@pdftron/pdfnet-node-samples 11.12.1 → 11.13.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.
@@ -23,7 +23,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
23
23
  const main = async () => {
24
24
 
25
25
  try {
26
- await PDFNet.addResourceSearchPath('../../lib/');
26
+ await PDFNet.addResourceSearchPath('../Lib/');
27
27
 
28
28
  if (!await PDFNet.AdvancedImagingModule.isModuleAvailable()) {
29
29
  console.log('\nUnable to run AdvancedImagingTest: Apryse SDK AdvancedImaging module not available.');
@@ -20,7 +20,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
20
20
  exports.runBarcodeTest = () => {
21
21
  const main = async () => {
22
22
 
23
- PDFNet.addResourceSearchPath('../../lib/');
23
+ PDFNet.addResourceSearchPath('../Lib/');
24
24
 
25
25
  if (!(await PDFNet.BarcodeModule.isModuleAvailable())) {
26
26
  console.log('\nUnable to run BarcodeTest: Apryse SDK Barcode Module not available.');
@@ -33,7 +33,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
33
33
 
34
34
  const main = async () => {
35
35
  try {
36
- await PDFNet.addResourceSearchPath('../../lib/');
36
+ await PDFNet.addResourceSearchPath('../Lib/');
37
37
  if (!(await PDFNet.CADModule.isModuleAvailable())) {
38
38
  console.log('\nUnable to run CAD2PDFTest: Apryse SDK CAD module not available.');
39
39
  console.log('---------------------------------------------------------------');
@@ -26,7 +26,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
26
26
 
27
27
  //////////////////////////////////////////////////////////////////////////
28
28
 
29
- await PDFNet.addResourceSearchPath('../../lib/');
29
+ await PDFNet.addResourceSearchPath('../Lib/');
30
30
 
31
31
  //////////////////////////////////////////////////////////////////////////
32
32
  // The following sample illustrates how to extract tables from PDF documents.
@@ -20,7 +20,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
20
20
  const main = async () => {
21
21
  try {
22
22
  // The location of the Handwriting ICR Module
23
- PDFNet.addResourceSearchPath('../../lib/');
23
+ PDFNet.addResourceSearchPath('../Lib/');
24
24
 
25
25
  if (!(await PDFNet.HandwritingICRModule.isModuleAvailable())) {
26
26
  console.log('\nUnable to run HandwritingICRTest: Apryse SDK Handwriting ICR Module');
@@ -56,6 +56,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
56
56
  }
57
57
 
58
58
  //--------------------------------------------------------------------------------
59
+ /*
59
60
  // Example 2) Process a subset of PDF pages
60
61
  try {
61
62
  console.log('Example 2: processing pages from icr.pdf');
@@ -67,7 +68,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
67
68
  const options = await PDFNet.HandwritingICRModule.createHandwritingICROptions();
68
69
 
69
70
  // Optionally, process a subset of pages
70
- options.setPages("2-3");
71
+ options.setPages("1-3");
71
72
 
72
73
  // Run ICR on the .pdf
73
74
  await PDFNet.HandwritingICRModule.processPDF(doc, options);
@@ -77,6 +78,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
77
78
  } catch (err) {
78
79
  console.log(err);
79
80
  }
81
+ */
80
82
 
81
83
  //--------------------------------------------------------------------------------
82
84
  // Example 3) Ignore zones specified for each page
@@ -89,13 +91,12 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
89
91
  // Process handwriting with custom options
90
92
  const options = await PDFNet.HandwritingICRModule.createHandwritingICROptions();
91
93
 
92
- // Process page 2 by ignoring the signature area on the bottom
93
- options.setPages("2");
94
- const ignore_zones_page2 = [];
94
+ // Process page 1 by ignoring the signature area on the bottom
95
+ const ignore_zones_page1 = [];
95
96
  // These coordinates are in PDF user space, with the origin at the bottom left corner of the page.
96
97
  // Coordinates rotate with the page, if it has rotation applied.
97
- ignore_zones_page2.push(new PDFNet.Rect(78, 850.1 - 770, 340, 850.1 - 676));
98
- options.addIgnoreZonesForPage(ignore_zones_page2, 2);
98
+ ignore_zones_page1.push(new PDFNet.Rect(78, 850.1 - 770, 340, 850.1 - 676));
99
+ options.addIgnoreZonesForPage(ignore_zones_page1, 1);
99
100
 
100
101
  // Run ICR on the .pdf
101
102
  await PDFNet.HandwritingICRModule.processPDF(doc, options);
@@ -17,7 +17,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
17
17
  const main = async () => {
18
18
  try {
19
19
 
20
- PDFNet.addResourceSearchPath('../../lib/');
20
+ PDFNet.addResourceSearchPath('../Lib/');
21
21
 
22
22
  const useIRIS = await PDFNet.OCRModule.isIRISModuleAvailable();
23
23
  if (!(await PDFNet.OCRModule.isModuleAvailable())) {
@@ -50,7 +50,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
50
50
 
51
51
  //////////////////////////////////////////////////////////////////////////
52
52
 
53
- await PDFNet.addResourceSearchPath('../../lib/');
53
+ await PDFNet.addResourceSearchPath('../Lib/');
54
54
 
55
55
  if (!await PDFNet.StructuredOutputModule.isModuleAvailable()) {
56
56
  console.log('\nUnable to run part of the sample: Apryse SDK Structured Output module not available.');
@@ -31,7 +31,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
31
31
 
32
32
  //////////////////////////////////////////////////////////////////////////
33
33
 
34
- await PDFNet.addResourceSearchPath('../../lib/');
34
+ await PDFNet.addResourceSearchPath('../Lib/');
35
35
 
36
36
  if (!await PDFNet.StructuredOutputModule.isModuleAvailable()) {
37
37
  console.log('\nUnable to run the sample: Apryse SDK Structured Output module not available.');
@@ -27,7 +27,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
27
27
 
28
28
  // DataExtraction library location, replace if desired, should point to a folder that includes the contents of <DataExtractionModuleRoot>/Lib.
29
29
  // If using default, unzip the DataExtraction zip to the parent folder of Samples, and merge with existing "Lib" folder
30
- const extraction_module_path = '../../lib/';
30
+ const extraction_module_path = '../Lib/';
31
31
 
32
32
  const input_file1 = input_path + 'autotag_input.pdf';
33
33
  const input_file2 = input_path + 'table.pdf';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdftron/pdfnet-node-samples",
3
- "version": "11.12.1",
3
+ "version": "11.13.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.apryse.com",
14
14
  "dependencies": {
15
- "@pdftron/pdfnet-node": "^11.12.1",
15
+ "@pdftron/pdfnet-node": "^11.13.0-beta",
16
16
  "run-script-os": "^1.1.6",
17
17
  "underscore": "^1.13.6",
18
18
  "xhr2": "^0.2.1"