@pdftron/pdfnet-node-samples 9.5.0-2 → 9.5.0-3-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.
Files changed (147) hide show
  1. package/{samples/AddImageTest → AddImageTest}/AddImageTest.js +2 -2
  2. package/{samples/AdvancedImagingTest → AdvancedImagingTest}/AdvancedImagingTest.js +6 -6
  3. package/{samples/AnnotationTest → AnnotationTest}/AnnotationTest.js +2 -2
  4. package/BarcodeTest/BarcodeTest.js +120 -0
  5. package/{samples/BookmarkTest → BookmarkTest}/BookmarkTest.js +2 -2
  6. package/{samples/CAD2PDFTest → CAD2PDFTest}/CAD2PDFTest.js +6 -6
  7. package/{samples/ContentReplacerTest → ContentReplacerTest}/ContentReplacerTest.js +2 -2
  8. package/ConvertPrintTest/ConvertPrintTest.js +153 -0
  9. package/{samples/ConvertTest → ConvertTest}/ConvertTest.js +13 -80
  10. package/DataExtractionTest/DataExtractionTest.js +311 -0
  11. package/{samples/DigitalSignaturesTest → DigitalSignaturesTest}/DigitalSignaturesTest.js +127 -13
  12. package/DocumentCreationTest/DocumentCreationTest.js +409 -0
  13. package/{samples/ElementBuilderTest → ElementBuilderTest}/ElementBuilderTest.js +2 -2
  14. package/{samples/ElementEditTest → ElementEditTest}/ElementEditTest.js +2 -2
  15. package/{samples/ElementReaderAdvTest → ElementReaderAdvTest}/ElementReaderAdvTest.js +2 -2
  16. package/{samples/ElementReaderTest → ElementReaderTest}/ElementReaderTest.js +2 -2
  17. package/{samples/EncTest → EncTest}/EncTest.js +2 -2
  18. package/{samples/FDFTest → FDFTest}/FDFTest.js +2 -2
  19. package/FindReplaceTest/FindReplaceTest.js +56 -0
  20. package/{samples/HTML2PDFTest → HTML2PDFTest}/HTML2PDFTest.js +35 -36
  21. package/{samples/HighlightsTest → HighlightsTest}/HighlightsTest.js +2 -2
  22. package/{samples/ImageExtractTest → ImageExtractTest}/ImageExtractTest.js +4 -4
  23. package/{samples/ImpositionTest → ImpositionTest}/ImpositionTest.js +2 -2
  24. package/{samples/InteractiveFormsTest → InteractiveFormsTest}/InteractiveFormsTest.js +2 -2
  25. package/{samples/JBIG2Test → JBIG2Test}/JBIG2Test.js +8 -8
  26. package/{samples/LicenseKey → LicenseKey}/LicenseKey.js +2 -2
  27. package/{samples/LogicalStructureTest → LogicalStructureTest}/LogicalStructureTest.js +2 -2
  28. package/{samples/OCRTest → OCRTest}/OCRTest.js +7 -6
  29. package/{samples/OfficeTemplateTest → OfficeTemplateTest}/OfficeTemplateTest.js +3 -3
  30. package/{samples/OfficeToPDFTest → OfficeToPDFTest}/OfficeToPDFTest.js +2 -2
  31. package/{samples/OptimizerTest → OptimizerTest}/OptimizerTest.js +2 -2
  32. package/{samples/PDF2HtmlTest → PDF2HtmlTest}/PDF2HtmlTest.js +7 -7
  33. package/{samples/PDF2OfficeTest → PDF2OfficeTest}/PDF2OfficeTest.js +7 -7
  34. package/{samples/PDFATest → PDFATest}/PDFATest.js +2 -2
  35. package/{samples/PDFDocMemoryTest → PDFDocMemoryTest}/PDFDocMemoryTest.js +2 -2
  36. package/{samples/PDFDrawTest → PDFDrawTest}/PDFDrawTest.js +2 -2
  37. package/{samples/PDFLayersTest → PDFLayersTest}/PDFLayersTest.js +2 -2
  38. package/{samples/PDFPackageTest → PDFPackageTest}/PDFPackageTest.js +2 -2
  39. package/{samples/PDFPageTest → PDFPageTest}/PDFPageTest.js +2 -2
  40. package/{samples/PDFRedactTest → PDFRedactTest}/PDFRedactTest.js +2 -2
  41. package/PDFUATest/PDFUATest.js +88 -0
  42. package/{samples/PageLabelsTest → PageLabelsTest}/PageLabelsTest.js +2 -2
  43. package/{samples/PatternTest → PatternTest}/PatternTest.js +2 -2
  44. package/{samples/RectTest → RectTest}/RectTest.js +2 -2
  45. package/{samples/SDFTest → SDFTest}/SDFTest.js +4 -5
  46. package/{samples/StamperTest → StamperTest}/StamperTest.js +2 -2
  47. package/TestFiles/BusinessCardTemplate.pdf +0 -0
  48. package/TestFiles/Email.pdf +0 -0
  49. package/TestFiles/Fishermen.docx +0 -0
  50. package/TestFiles/Font_licenses.txt +140 -0
  51. package/TestFiles/Invoice.pdf +0 -0
  52. package/TestFiles/License.txt +1 -0
  53. package/TestFiles/Misc-Fixed.pfa +1166 -0
  54. package/TestFiles/NotoSans_with_hindi.ttf +0 -0
  55. package/TestFiles/Output/empty +1 -0
  56. package/TestFiles/SHA-2 Root USERTrust RSA CA Sectigo timestamping.crt +34 -0
  57. package/TestFiles/SYH_Letter.docx +0 -0
  58. package/TestFiles/Scientific_Publication.pdf +0 -0
  59. package/TestFiles/TigerText.pdf +0 -0
  60. package/TestFiles/US061222892-a.pdf +0 -0
  61. package/TestFiles/apryse.bmp +0 -0
  62. package/TestFiles/apryse.cer +0 -0
  63. package/TestFiles/apryse.pfx +0 -0
  64. package/TestFiles/autotag_input.pdf +0 -0
  65. package/TestFiles/butterfly.png +0 -0
  66. package/TestFiles/credit card numbers.pdf +0 -0
  67. package/TestFiles/dice.jpg +0 -0
  68. package/TestFiles/dice.u3d +0 -0
  69. package/TestFiles/doc_to_sign.pdf +0 -0
  70. package/TestFiles/factsheet_Arabic.docx +0 -0
  71. package/TestFiles/financial.pdf +0 -0
  72. package/TestFiles/find-replace-test.pdf +0 -0
  73. package/TestFiles/find-replace-test_(en_to_fr).xlf +88 -0
  74. package/TestFiles/fish.pdf +0 -0
  75. package/TestFiles/font.ttf +0 -0
  76. package/TestFiles/form1.pdf +246 -0
  77. package/TestFiles/form1_annots.xfdf +34 -0
  78. package/TestFiles/form1_data.fdf +4 -0
  79. package/TestFiles/form1_data.xfdf +140 -0
  80. package/TestFiles/formfields-scanned-withfields.pdf +0 -0
  81. package/TestFiles/formfields-scanned.pdf +0 -0
  82. package/TestFiles/formfields.pdf +0 -0
  83. package/TestFiles/grayscale.tif +0 -0
  84. package/TestFiles/hindi_sample_utf16le.txt +0 -0
  85. package/TestFiles/imagemask.dat +32 -0
  86. package/TestFiles/logo_red.png +0 -0
  87. package/TestFiles/lorem_ipsum.pdf +0 -0
  88. package/TestFiles/multipage.tif +0 -0
  89. package/TestFiles/my_stream.txt +2310 -0
  90. package/TestFiles/newsletter.pdf +0 -0
  91. package/TestFiles/newsletter.xod +0 -0
  92. package/TestFiles/numbered.pdf +0 -0
  93. package/TestFiles/op_blend_test.pdf +1497 -1
  94. package/TestFiles/palm.jp2 +0 -0
  95. package/TestFiles/paragraphs_and_tables.pdf +0 -0
  96. package/TestFiles/pdfnet.gif +0 -0
  97. package/TestFiles/pdftron_smart_substitution.plugin +0 -0
  98. package/TestFiles/peppers.jpg +0 -0
  99. package/TestFiles/signature.jpg +0 -0
  100. package/TestFiles/simple-emf.emf +0 -0
  101. package/TestFiles/simple-excel_2007.xlsx +0 -0
  102. package/TestFiles/simple-outlook.msg +0 -0
  103. package/TestFiles/simple-powerpoint_2007.pptx +0 -0
  104. package/TestFiles/simple-publisher.pub +0 -0
  105. package/TestFiles/simple-rtf.rtf +224 -0
  106. package/TestFiles/simple-text.txt +61 -0
  107. package/TestFiles/simple-visio.vsd +0 -0
  108. package/TestFiles/simple-webpage.html +731 -0
  109. package/TestFiles/simple-webpage.mht +6972 -0
  110. package/TestFiles/simple-webpage_files/colorschememapping.xml +2 -0
  111. package/TestFiles/simple-webpage_files/filelist.xml +14 -0
  112. package/TestFiles/simple-webpage_files/image001.gif +0 -0
  113. package/TestFiles/simple-webpage_files/image002.png +0 -0
  114. package/TestFiles/simple-webpage_files/image003.jpg +0 -0
  115. package/TestFiles/simple-webpage_files/image004.emz +0 -0
  116. package/TestFiles/simple-webpage_files/image005.gif +0 -0
  117. package/TestFiles/simple-webpage_files/image006.png +0 -0
  118. package/TestFiles/simple-webpage_files/image007.gif +0 -0
  119. package/TestFiles/simple-webpage_files/oledata.mso +0 -0
  120. package/TestFiles/simple-webpage_files/themedata.thmx +0 -0
  121. package/TestFiles/simple-word_2007.docx +0 -0
  122. package/TestFiles/simple-xps.xps +0 -0
  123. package/TestFiles/table.pdf +0 -0
  124. package/TestFiles/tagged.pdf +0 -0
  125. package/TestFiles/the_rime_of_the_ancient_mariner.docx +0 -0
  126. package/TestFiles/tiger.pdf +0 -0
  127. package/TestFiles/tiger.svg +378 -0
  128. package/TestFiles/waiver.pdf +0 -0
  129. package/TestFiles/waiver_withApprovalField.pdf +0 -0
  130. package/TestFiles/waiver_withApprovalField_certified.pdf +421 -1
  131. package/TestFiles/waiver_withApprovalField_certified_approved.pdf +465 -1
  132. package/{samples/TextExtractTest → TextExtractTest}/TextExtractTest.js +2 -2
  133. package/{samples/TextSearchTest → TextSearchTest}/TextSearchTest.js +3 -3
  134. package/TransPDFTest/TransPDFTest.js +68 -0
  135. package/{samples/U3DTest → U3DTest}/U3DTest.js +2 -2
  136. package/{samples/UndoRedoTest → UndoRedoTest}/UndoRedoTest.js +2 -2
  137. package/{samples/UnicodeWriteTest → UnicodeWriteTest}/UnicodeWriteTest.js +2 -2
  138. package/{samples/WebViewerConvertTest → WebViewerConvertTest}/WebViewerConvertTest.js +3 -3
  139. package/legal.txt +632 -0
  140. package/license.pdf +0 -0
  141. package/package.json +9 -7
  142. package/readme.md +32 -7
  143. package/runall.bat +12 -0
  144. package/{samples/runall.sh → runall.sh} +5 -4
  145. package/scripts/install.js +68 -0
  146. package/samples/DataExtractionTest/DataExtractionTest.js +0 -180
  147. package/samples/runall.bat +0 -13
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -10,7 +10,7 @@
10
10
  // 'pdftron.PDF.HTML2PDF' is an optional PDFNet Add-On utility class that can be
11
11
  // used to convert HTML web pages into PDF documents by using an external module (html2pdf).
12
12
  //
13
- // html2pdf modules can be downloaded from http://www.pdftron.com/pdfnet/downloads.html.
13
+ // html2pdf modules can be downloaded from https://docs.apryse.com/core/guides/info/modules#html2pdf-module
14
14
  //
15
15
  // Users can convert HTML pages to PDF using the following operations:
16
16
  // - Simple one line static method to convert a single web page to PDF.
@@ -20,7 +20,7 @@
20
20
  // - Optionally add table of contents, including setting the depth and appearance.
21
21
  //---------------------------------------------------------------------------------------
22
22
 
23
- const { PDFNet } = require('../lib/pdfnet.js');
23
+ const { PDFNet } = require('@pdftron/pdfnet-node');
24
24
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
25
25
 
26
26
  ((exports) => {
@@ -29,20 +29,21 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
29
29
  exports.runHTML2PDFTest = () => {
30
30
  const main = async () => {
31
31
  const outputPath = '../TestFiles/Output/html2pdf_example';
32
- const host = 'https://www.pdftron.com';
32
+ const host = 'https://docs.apryse.com';
33
33
  const page0 = '/';
34
- const page1 = '/support';
35
- const page2 = '/blog';
34
+ const page1 = '/all-products/';
35
+ const page2 = '/documentation/web/faq';
36
+
36
37
  // For HTML2PDF we need to locate the html2pdf module. If placed with the
37
38
  // PDFNet library, or in the current working directory, it will be loaded
38
39
  // automatically. Otherwise, it must be set manually using HTML2PDF.setModulePath.
39
- await PDFNet.HTML2PDF.setModulePath('../lib/');
40
+ await PDFNet.HTML2PDF.setModulePath('../../lib/');
40
41
 
41
42
  if(!(await PDFNet.HTML2PDF.isModuleAvailable())) {
42
- console.log('Unable to run HTML2PDFTest: PDFTron SDK HTML2PDF module not available.');
43
+ console.log('Unable to run HTML2PDFTest: Apryse SDK HTML2PDF module not available.');
43
44
  console.log('---------------------------------------------------------------');
44
45
  console.log('The HTML2PDF module is an optional add-on, available for download');
45
- console.log('at https://www.pdftron.com/. If you have already downloaded this');
46
+ console.log('at https://www.apryse.com/. If you have already downloaded this');
46
47
  console.log('module, ensure that the SDK is able to find the required files');
47
48
  console.log('using the HTML2PDF.setModulePath() function.');
48
49
 
@@ -58,11 +59,8 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
58
59
 
59
60
  html2pdf.insertFromUrl(host.concat(page0));
60
61
  // now convert a web page, sending generated PDF pages to doc
61
- if (await html2pdf.convert(doc)) {
62
- doc.save(outputPath.concat('_01.pdf'), PDFNet.SDFDoc.SaveOptions.e_linearized);
63
- } else {
64
- console.log('Conversion failed.');
65
- }
62
+ await html2pdf.convert(doc);
63
+ doc.save(outputPath.concat('_01.pdf'), PDFNet.SDFDoc.SaveOptions.e_linearized);
66
64
  } catch (err) {
67
65
  console.log(err);
68
66
  }
@@ -84,12 +82,8 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
84
82
  html2pdf.insertFromUrl(host.concat(page0));
85
83
 
86
84
  // convert the web page, appending generated PDF pages to doc
87
- if (await html2pdf.convert(doc)) {
88
- doc.save(outputPath.concat('_02.pdf'), PDFNet.SDFDoc.SaveOptions.e_linearized);
89
- } else {
90
- console.log('Conversion failed. HTTP Code: ' + await html2pdf.getHttpErrorCode());
91
- console.log(await html2pdf.getLog());
92
- }
85
+ await html2pdf.convert(doc);
86
+ doc.save(outputPath.concat('_02.pdf'), PDFNet.SDFDoc.SaveOptions.e_linearized);
93
87
  } catch (err) {
94
88
  console.log(err);
95
89
  }
@@ -111,11 +105,11 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
111
105
  const settings = await PDFNet.HTML2PDF.WebPageSettings.create();
112
106
  await settings.setZoom(0.5);
113
107
  converter.insertFromUrl2(host.concat(page0), settings);
114
- const is_conversion_0_successful = await converter.convert(doc);
108
+ await converter.convert(doc);
115
109
 
116
110
  // convert page 1 with the same settings, appending generated PDF pages to doc
117
111
  converter.insertFromUrl2(host.concat(page1), settings);
118
- const is_conversion_1_successful = await converter.convert(doc);
112
+ await converter.convert(doc);
119
113
 
120
114
  // convert page 2 with different settings, appending generated PDF pages to doc
121
115
  const another_converter = await PDFNet.HTML2PDF.create();
@@ -123,14 +117,9 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
123
117
  const another_settings = await PDFNet.HTML2PDF.WebPageSettings.create();
124
118
  another_settings.setPrintBackground(false);
125
119
  another_converter.insertFromUrl2(host.concat(page2), another_settings);
126
- const is_conversion_2_successful = await another_converter.convert(doc);
127
-
128
- if(is_conversion_0_successful && is_conversion_1_successful && is_conversion_2_successful) {
129
- doc.save(outputPath.concat('_03.pdf'), PDFNet.SDFDoc.SaveOptions.e_linearized);
130
- } else {
131
- console.log('Conversion failed. HTTP Code: ' + await html2pdf.getHttpErrorCode());
132
- console.log(await html2pdf.getLog());
133
- }
120
+ await another_converter.convert(doc);
121
+
122
+ doc.save(outputPath.concat('_03.pdf'), PDFNet.SDFDoc.SaveOptions.e_linearized);
134
123
  } catch (err) {
135
124
  console.log(err);
136
125
  }
@@ -144,12 +133,22 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
144
133
  const html = '<html><body><h1>Heading</h1><p>Paragraph.</p></body></html>';
145
134
 
146
135
  html2pdf.insertFromHtmlString(html);
147
- if (await html2pdf.convert(doc)) {
148
- doc.save(outputPath.concat('_04.pdf'), PDFNet.SDFDoc.SaveOptions.e_linearized);
149
- } else {
150
- console.log('Conversion failed. HTTP Code: ' + await html2pdf.getHttpErrorCode());
151
- console.log(await html2pdf.getLog());
152
- }
136
+ await html2pdf.convert(doc);
137
+ doc.save(outputPath.concat('_04.pdf'), PDFNet.SDFDoc.SaveOptions.e_linearized);
138
+ } catch (err) {
139
+ console.log(err);
140
+ }
141
+
142
+ //--------------------------------------------------------------------------------
143
+ // Example 5) Set the location of the log file to be used during conversion.
144
+
145
+ try {
146
+ const html2pdf = await PDFNet.HTML2PDF.create();
147
+ const doc = await PDFNet.PDFDoc.create();
148
+ html2pdf.setLogFilePath('../TestFiles/Output/html2pdf.log');
149
+ html2pdf.insertFromUrl(host.concat(page0));
150
+ await html2pdf.convert(doc);
151
+ doc.save(outputPath.concat('_05.pdf'), PDFNet.SDFDoc.SaveOptions.e_linearized);
153
152
  } catch (err) {
154
153
  console.log(err);
155
154
  }
@@ -1,10 +1,10 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
6
6
 
7
- const { PDFNet } = require('../lib/pdfnet.js');
7
+ const { PDFNet } = require('@pdftron/pdfnet-node');
8
8
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
9
9
 
10
10
  // This sample illustrates the basic text highlight capabilities of PDFNet.
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -13,7 +13,7 @@
13
13
  // sample project).
14
14
  //-----------------------------------------------------------------------------------
15
15
 
16
- const { PDFNet } = require('../lib/pdfnet.js');
16
+ const { PDFNet } = require('@pdftron/pdfnet-node');
17
17
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
18
18
 
19
19
  ((exports) => {
@@ -98,11 +98,11 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
98
98
  if (obj && !(await obj.isFree()) && await obj.isStream()) {
99
99
  // Process only images
100
100
  var itr = await obj.find('Type');
101
- if (!(await itr.hasNext()) || await (await itr.value()).getName() !== 'XObject')
101
+ if (!(await itr.hasCurrent()) || await (await itr.value()).getName() !== 'XObject')
102
102
  continue;
103
103
 
104
104
  itr = await obj.find('Subtype');
105
- if (!(await itr.hasNext()) || await (await itr.value()).getName() !== 'Image')
105
+ if (!(await itr.hasCurrent()) || await (await itr.value()).getName() !== 'Image')
106
106
  continue;
107
107
  const image = await PDFNet.Image.createFromObj(obj);
108
108
  console.log('--> Image: ' + ++image_counter);
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -12,7 +12,7 @@
12
12
  // when the hard copy pages are compiled and folded correctly.
13
13
  //-----------------------------------------------------------------------------------
14
14
 
15
- const { PDFNet } = require('../lib/pdfnet.js');
15
+ const { PDFNet } = require('@pdftron/pdfnet-node');
16
16
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
17
17
 
18
18
  ((exports) => {
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -7,7 +7,7 @@
7
7
  // This sample illustrates basic PDFNet capabilities related to interactive
8
8
  // forms (also known as AcroForms).
9
9
  //---------------------------------------------------------------------------------------
10
- const { PDFNet } = require('../lib/pdfnet.js');
10
+ const { PDFNet } = require('@pdftron/pdfnet-node');
11
11
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
12
12
 
13
13
  ((exports) => {
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -9,10 +9,10 @@
9
9
  // to be a generic PDF optimization tool.
10
10
  //
11
11
  // You can download the entire document using the following link:
12
- // http://www.pdftron.com/net/samplecode/data/US061222892.pdf
12
+ // https://downloads.apryse.com/files/US061222892.pdf
13
13
  //
14
14
 
15
- const { PDFNet } = require('../lib/pdfnet.js');
15
+ const { PDFNet } = require('@pdftron/pdfnet-node');
16
16
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
17
17
 
18
18
  ((exports) => {
@@ -31,7 +31,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
31
31
  if (obj && !(await obj.isFree()) && await obj.isStream()) {
32
32
  // Process only images
33
33
  let itr = await obj.find('Subtype');
34
- if (!(await itr.hasNext()) || await (await itr.value()).getName() !== 'Image')
34
+ if (!(await itr.hasCurrent()) || await (await itr.value()).getName() !== 'Image')
35
35
  continue;
36
36
  const input_image = await PDFNet.Image.createFromObj(obj);
37
37
  // Process only gray-scale images
@@ -42,7 +42,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
42
42
 
43
43
  // Skip images that are already compressed using JBIG2
44
44
  itr = await obj.find('Filter');
45
- if (await itr.hasNext()) {
45
+ if (await itr.hasCurrent()) {
46
46
  const value = await itr.value();
47
47
  if (await value.isName() && await value.getName() === 'JBIG2Decode') continue;
48
48
  }
@@ -61,13 +61,13 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
61
61
 
62
62
  const new_img_obj = await new_image.getSDFObj();
63
63
  itr = await obj.find('Decode');
64
- if (await itr.hasNext())
64
+ if (await itr.hasCurrent())
65
65
  new_img_obj.put('Decode', await itr.value());
66
66
  itr = await obj.find('ImageMask');
67
- if (await itr.hasNext())
67
+ if (await itr.hasCurrent())
68
68
  new_img_obj.put('ImageMask', await itr.value());
69
69
  itr = await obj.find('Mask');
70
- if (await itr.hasNext())
70
+ if (await itr.hasCurrent())
71
71
  new_img_obj.put('Mask', await itr.value());
72
72
 
73
73
  await cos_doc.swap(i, await new_img_obj.getObjNum());
@@ -1,9 +1,9 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
6
- //"Enter your key here. If you don't have it, please go to https://www.pdftron.com/pws/get-key to obtain a demo license or https://www.pdftron.com/form/contact-sales to obtain a production key.
6
+ //"Enter your key here. If you don't have it, please go to https://www.apryse.com/pws/get-key to obtain a demo license or https://www.apryse.com/form/contact-sales to obtain a production key.
7
7
  const LicenseKey = 'YOUR_PDFTRON_LICENSE_KEY';
8
8
  if(LicenseKey == 'YOUR_PDFTRON_LICENSE_KEY'){
9
9
  throw ('Please enter your license key by replacing \'YOUR_PDFTRON_LICENSE_KEY\' that is assigned to the LicenseKey variable in Samples/LicenseKey/LicenseKey.js. If you do not have a license key, please go to https://www.pdftron.com/pws/get-key to obtain a demo license or https://www.pdftron.com/form/contact-sales to obtain a production key.');
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -16,7 +16,7 @@
16
16
  //---------------------------------------------------------------------------------------
17
17
 
18
18
 
19
- const { PDFNet } = require('../lib/pdfnet.js');
19
+ const { PDFNet } = require('@pdftron/pdfnet-node');
20
20
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
21
21
 
22
22
  ((exports) => {
@@ -1,10 +1,10 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
6
6
 
7
- const { PDFNet } = require('../lib/pdfnet.js');
7
+ const { PDFNet } = require('@pdftron/pdfnet-node');
8
8
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
9
9
 
10
10
  ((exports) => {
@@ -17,14 +17,14 @@ 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())) {
24
- console.log('\nUnable to run OCRTest: PDFTron SDK OCR module not available.');
24
+ console.log('\nUnable to run OCRTest: Apryse SDK OCR module not available.');
25
25
  console.log('---------------------------------------------------------------');
26
26
  console.log('The OCR module is an optional add-on, available for download');
27
- console.log('at http://www.pdftron.com/. If you have already downloaded this');
27
+ console.log('at http://www.apryse.com/. If you have already downloaded this');
28
28
  console.log('module, ensure that the SDK is able to find the required files');
29
29
  console.log('using the PDFNet.addResourceSearchPath() function.\n');
30
30
 
@@ -69,8 +69,9 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
69
69
  // B) Setup options with multiple target languages, English will always be considered as secondary language
70
70
  const opts = new PDFNet.OCRModule.OCROptions();
71
71
  if(useIRIS) opts.setOCREngine('iris');
72
- opts.addLang('rus');
73
72
  opts.addLang('deu');
73
+ opts.addLang('fra');
74
+ opts.addLang('eng');
74
75
 
75
76
  // C) Run OCR on the .jpg with options
76
77
  await PDFNet.OCRModule.imageToPDF(doc, input_path + 'multi_lang.jpg', opts);
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -9,7 +9,7 @@
9
9
  // with content supplied via json
10
10
  //
11
11
  // For a detailed specification of the template format and supported features,
12
- // see: https://www.pdftron.com/documentation/core/guides/generate-via-template/data-model/
12
+ // see: https://docs.apryse.com/documentation/core/guides/generate-via-template/data-model/
13
13
  //
14
14
  // This conversion is performed entirely within the PDFNet and has *no*
15
15
  // external or system dependencies -- Conversion results will be
@@ -18,7 +18,7 @@
18
18
  // Please contact us if you have any questions.
19
19
  //------------------------------------------------------------------------------
20
20
 
21
- const { PDFNet } = require('../lib/pdfnet.js');
21
+ const { PDFNet } = require('@pdftron/pdfnet-node');
22
22
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
23
23
 
24
24
  ((exports) => {
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -14,7 +14,7 @@
14
14
  // Please contact us if you have any questions.
15
15
  //------------------------------------------------------------------------------
16
16
 
17
- const { PDFNet } = require('../lib/pdfnet.js');
17
+ const { PDFNet } = require('@pdftron/pdfnet-node');
18
18
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
19
19
 
20
20
  ((exports) => {
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -33,7 +33,7 @@
33
33
  // very simple representation (e.g. vector text on top of a background image).
34
34
  //---------------------------------------------------------------------------------------
35
35
 
36
- const { PDFNet } = require('../lib/pdfnet.js');
36
+ const { PDFNet } = require('@pdftron/pdfnet-node');
37
37
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
38
38
 
39
39
  ((exports) => {
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -13,13 +13,13 @@
13
13
  // 2. The optional Structured Output add-on module is used to convert PDF documents to
14
14
  // HTML documents with text flowing across the browser window.
15
15
  //
16
- // The PDFTron SDK Structured Output module can be downloaded from
17
- // https://www.pdftron.com/documentation/core/info/modules/
16
+ // The Apryse SDK Structured Output module can be downloaded from
17
+ // https://docs.apryse.com/documentation/core/info/modules/
18
18
  //
19
19
  // Please contact us if you have any questions.
20
20
  //---------------------------------------------------------------------------------------
21
21
 
22
- const { PDFNet } = require('../lib/pdfnet.js');
22
+ const { PDFNet } = require('@pdftron/pdfnet-node');
23
23
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
24
24
 
25
25
  ((exports) => {
@@ -50,13 +50,13 @@ 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
- console.log('\nUnable to run part of the sample: PDFTron SDK Structured Output module not available.');
56
+ console.log('\nUnable to run part of the sample: Apryse SDK Structured Output module not available.');
57
57
  console.log('---------------------------------------------------------------');
58
58
  console.log('The Structured Output module is an optional add-on, available for download');
59
- console.log('at https://www.pdftron.com/documentation/core/info/modules/. If you have already');
59
+ console.log('at https://docs.apryse.com/documentation/core/info/modules/. If you have already');
60
60
  console.log('downloaded this module, ensure that the SDK is able to find the required files');
61
61
  console.log('using the PDFNet::AddResourceSearchPath() function.\n');
62
62
 
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -10,13 +10,13 @@
10
10
  // The Structured Output module is an optional PDFNet Add-on that can be used to convert PDF
11
11
  // and other documents into Word, Excel, PowerPoint and HTML format.
12
12
  //
13
- // The PDFTron SDK Structured Output module can be downloaded from
14
- // https://www.pdftron.com/documentation/core/info/modules/
13
+ // The Apryse SDK Structured Output module can be downloaded from
14
+ // https://docs.apryse.com/documentation/core/info/modules/
15
15
  //
16
16
  // Please contact us if you have any questions.
17
17
  //---------------------------------------------------------------------------------------
18
18
 
19
- const { PDFNet } = require('../lib/pdfnet.js');
19
+ const { PDFNet } = require('@pdftron/pdfnet-node');
20
20
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
21
21
 
22
22
  ((exports) => {
@@ -31,13 +31,13 @@ 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
- console.log('\nUnable to run the sample: PDFTron SDK Structured Output module not available.');
37
+ console.log('\nUnable to run the sample: Apryse SDK Structured Output module not available.');
38
38
  console.log('---------------------------------------------------------------');
39
39
  console.log('The Structured Output module is an optional add-on, available for download');
40
- console.log('at https://www.pdftron.com/documentation/core/info/modules/. If you have already');
40
+ console.log('at https://docs.apryse.com/documentation/core/info/modules/. If you have already');
41
41
  console.log('downloaded this module, ensure that the SDK is able to find the required files');
42
42
  console.log('using the PDFNet::AddResourceSearchPath() function.\n');
43
43
 
@@ -1,9 +1,9 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
6
- const { PDFNet } = require('../lib/pdfnet.js');
6
+ const { PDFNet } = require('@pdftron/pdfnet-node');
7
7
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
8
8
 
9
9
  ((exports) => {
@@ -1,10 +1,10 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
6
6
  const fs = require('fs');
7
- const { PDFNet } = require('../lib/pdfnet.js');
7
+ const { PDFNet } = require('@pdftron/pdfnet-node');
8
8
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
9
9
 
10
10
  ((exports) => {
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -10,7 +10,7 @@
10
10
  //---------------------------------------------------------------------------------------
11
11
 
12
12
  const fs = require('fs');
13
- const { PDFNet } = require('../lib/pdfnet.js');
13
+ const { PDFNet } = require('@pdftron/pdfnet-node');
14
14
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
15
15
 
16
16
  ((exports) => {
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -28,7 +28,7 @@
28
28
  // to process.
29
29
  //-----------------------------------------------------------------------------------
30
30
 
31
- const { PDFNet } = require('../lib/pdfnet.js');
31
+ const { PDFNet } = require('@pdftron/pdfnet-node');
32
32
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
33
33
 
34
34
  ((exports) => {
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -8,7 +8,7 @@
8
8
  /// (a.k.a. PDF Packages) using PDFNet SDK.
9
9
  //-----------------------------------------------------------------------------------
10
10
 
11
- const { PDFNet } = require('../lib/pdfnet.js');
11
+ const { PDFNet } = require('@pdftron/pdfnet-node');
12
12
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
13
13
 
14
14
  ((exports) => {
@@ -1,9 +1,9 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
6
- const { PDFNet } = require('../lib/pdfnet.js');
6
+ const { PDFNet } = require('@pdftron/pdfnet-node');
7
7
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
8
8
 
9
9
  ((exports) => {
@@ -1,5 +1,5 @@
1
1
  //---------------------------------------------------------------------------------------
2
- // Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
2
+ // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3
3
  // Consult legal.txt regarding legal and license information.
4
4
  //---------------------------------------------------------------------------------------
5
5
 
@@ -32,7 +32,7 @@
32
32
  // document, including XML Forms Architecture (XFA) content and Extensible Metadata
33
33
  // Platform (XMP) content.
34
34
 
35
- const { PDFNet } = require('../lib/pdfnet.js');
35
+ const { PDFNet } = require('@pdftron/pdfnet-node');
36
36
  const PDFTronLicense = require('../LicenseKey/LicenseKey');
37
37
 
38
38
  ((exports) => {