@pdftron/pdfnet-node-samples 9.5.0-beta → 10.0.0-3
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.
- package/package.json +3 -3
- package/samples/AddImageTest/AddImageTest.js +1 -1
- package/samples/AdvancedImagingTest/AdvancedImagingTest.js +3 -3
- package/samples/AnnotationTest/AnnotationTest.js +1 -1
- package/samples/BookmarkTest/BookmarkTest.js +1 -1
- package/samples/CAD2PDFTest/CAD2PDFTest.js +3 -3
- package/samples/ContentReplacerTest/ContentReplacerTest.js +1 -1
- package/samples/ConvertTest/ConvertTest.js +1 -1
- package/samples/DataExtractionTest/DataExtractionTest.js +7 -7
- package/samples/DigitalSignaturesTest/DigitalSignaturesTest.js +1 -1
- package/samples/DocumentCreationTest/DocumentCreationTest.js +78 -0
- package/samples/ElementBuilderTest/ElementBuilderTest.js +1 -1
- package/samples/ElementEditTest/ElementEditTest.js +1 -1
- package/samples/ElementReaderAdvTest/ElementReaderAdvTest.js +1 -1
- package/samples/ElementReaderTest/ElementReaderTest.js +1 -1
- package/samples/EncTest/EncTest.js +1 -1
- package/samples/FDFTest/FDFTest.js +1 -1
- package/samples/HTML2PDFTest/HTML2PDFTest.js +2 -2
- package/samples/HighlightsTest/HighlightsTest.js +1 -1
- package/samples/ImageExtractTest/ImageExtractTest.js +1 -1
- package/samples/ImpositionTest/ImpositionTest.js +1 -1
- package/samples/InteractiveFormsTest/InteractiveFormsTest.js +1 -1
- package/samples/JBIG2Test/JBIG2Test.js +1 -1
- package/samples/LicenseKey/LicenseKey.js +1 -1
- package/samples/LogicalStructureTest/LogicalStructureTest.js +1 -1
- package/samples/OCRTest/OCRTest.js +2 -2
- package/samples/OfficeTemplateTest/OfficeTemplateTest.js +1 -1
- package/samples/OfficeToPDFTest/OfficeToPDFTest.js +1 -1
- package/samples/OptimizerTest/OptimizerTest.js +1 -1
- package/samples/PDF2HtmlTest/PDF2HtmlTest.js +3 -3
- package/samples/PDF2OfficeTest/PDF2OfficeTest.js +3 -3
- package/samples/PDFATest/PDFATest.js +1 -1
- package/samples/PDFDocMemoryTest/PDFDocMemoryTest.js +1 -1
- package/samples/PDFDrawTest/PDFDrawTest.js +1 -1
- package/samples/PDFLayersTest/PDFLayersTest.js +1 -1
- package/samples/PDFPackageTest/PDFPackageTest.js +1 -1
- package/samples/PDFPageTest/PDFPageTest.js +1 -1
- package/samples/PDFRedactTest/PDFRedactTest.js +1 -1
- package/samples/PageLabelsTest/PageLabelsTest.js +1 -1
- package/samples/PatternTest/PatternTest.js +1 -1
- package/samples/RectTest/RectTest.js +1 -1
- package/samples/SDFTest/SDFTest.js +1 -1
- package/samples/StamperTest/StamperTest.js +1 -1
- package/samples/TextExtractTest/TextExtractTest.js +1 -1
- package/samples/TextSearchTest/TextSearchTest.js +1 -1
- package/samples/U3DTest/U3DTest.js +1 -1
- package/samples/UndoRedoTest/UndoRedoTest.js +1 -1
- package/samples/UnicodeWriteTest/UnicodeWriteTest.js +1 -1
- package/samples/WebViewerConvertTest/WebViewerConvertTest.js +1 -1
- package/samples/AddImageTest/NODEJS/AddImageTest.js +0 -116
- package/samples/AddImageTest/NODEJS/RunTest.sh +0 -2
- package/samples/AdvancedImagingTest/NODEJS/AdvancedImagingTest.js +0 -78
- package/samples/AdvancedImagingTest/NODEJS/RunTest.sh +0 -2
- package/samples/AnnotationTest/NODEJS/AnnotationTest.js +0 -642
- package/samples/AnnotationTest/NODEJS/RunTest.sh +0 -2
- package/samples/BookmarkTest/NODEJS/BookmarkTest.js +0 -220
- package/samples/BookmarkTest/NODEJS/RunTest.sh +0 -2
- package/samples/CAD2PDFTest/NODEJS/CAD2PDFTest.js +0 -80
- package/samples/CAD2PDFTest/NODEJS/RunTest.sh +0 -2
- package/samples/ContentReplacerTest/NODEJS/ContentReplacerTest.js +0 -75
- package/samples/ContentReplacerTest/NODEJS/RunTest.sh +0 -2
- package/samples/ConvertTest/NODEJS/ConvertTest.js +0 -270
- package/samples/ConvertTest/NODEJS/RunTest.sh +0 -2
- package/samples/DataExtractionTest/NODEJS/DataExtractionTest.js +0 -180
- package/samples/DataExtractionTest/NODEJS/RunTest.sh +0 -2
- package/samples/DigitalSignaturesTest/NODEJS/DigitalSignaturesTest.js +0 -527
- package/samples/DigitalSignaturesTest/NODEJS/RunTest.sh +0 -2
- package/samples/ElementBuilderTest/NODEJS/ElementBuilderTest.js +0 -514
- package/samples/ElementBuilderTest/NODEJS/RunTest.sh +0 -2
- package/samples/ElementEditTest/NODEJS/ElementEditTest.js +0 -111
- package/samples/ElementEditTest/NODEJS/RunTest.sh +0 -2
- package/samples/ElementReaderAdvTest/NODEJS/ElementReaderAdvTest.js +0 -305
- package/samples/ElementReaderAdvTest/NODEJS/RunTest.sh +0 -2
- package/samples/ElementReaderTest/NODEJS/ElementReaderTest.js +0 -77
- package/samples/ElementReaderTest/NODEJS/RunTest.sh +0 -2
- package/samples/EncTest/NODEJS/EncTest.js +0 -176
- package/samples/EncTest/NODEJS/RunTest.sh +0 -2
- package/samples/FDFTest/NODEJS/FDFTest.js +0 -219
- package/samples/FDFTest/NODEJS/RunTest.sh +0 -2
- package/samples/HTML2PDFTest/NODEJS/HTML2PDFTest.js +0 -166
- package/samples/HTML2PDFTest/NODEJS/RunTest.sh +0 -2
- package/samples/HighlightsTest/NODEJS/HighlightsTest.js +0 -97
- package/samples/HighlightsTest/NODEJS/RunTest.sh +0 -2
- package/samples/ImageExtractTest/NODEJS/ImageExtractTest.js +0 -130
- package/samples/ImageExtractTest/NODEJS/RunTest.sh +0 -2
- package/samples/ImpositionTest/NODEJS/ImpositionTest.js +0 -87
- package/samples/ImpositionTest/NODEJS/RunTest.sh +0 -2
- package/samples/InteractiveFormsTest/NODEJS/InteractiveFormsTest.js +0 -382
- package/samples/InteractiveFormsTest/NODEJS/RunTest.sh +0 -2
- package/samples/JBIG2Test/NODEJS/JBIG2Test.js +0 -89
- package/samples/JBIG2Test/NODEJS/RunTest.sh +0 -2
- package/samples/LicenseKey/NODEJS/LicenseKey.js +0 -11
- package/samples/LogicalStructureTest/NODEJS/LogicalStructureTest.js +0 -251
- package/samples/LogicalStructureTest/NODEJS/RunTest.sh +0 -2
- package/samples/OCRTest/NODEJS/OCRTest.js +0 -235
- package/samples/OCRTest/NODEJS/RunTest.sh +0 -2
- package/samples/OfficeTemplateTest/NODEJS/OfficeTemplateTest.js +0 -79
- package/samples/OfficeTemplateTest/NODEJS/RunTest.sh +0 -2
- package/samples/OfficeToPDFTest/NODEJS/OfficeToPDFTest.js +0 -125
- package/samples/OfficeToPDFTest/NODEJS/RunTest.sh +0 -2
- package/samples/OptimizerTest/NODEJS/OptimizerTest.js +0 -192
- package/samples/OptimizerTest/NODEJS/RunTest.sh +0 -2
- package/samples/PDF2HtmlTest/NODEJS/PDF2HtmlTest.js +0 -123
- package/samples/PDF2HtmlTest/NODEJS/RunTest.sh +0 -2
- package/samples/PDF2OfficeTest/NODEJS/PDF2OfficeTest.js +0 -158
- package/samples/PDF2OfficeTest/NODEJS/RunTest.sh +0 -2
- package/samples/PDFATest/NODEJS/PDFATest.js +0 -85
- package/samples/PDFATest/NODEJS/RunTest.sh +0 -2
- package/samples/PDFDocMemoryTest/NODEJS/PDFDocMemoryTest.js +0 -85
- package/samples/PDFDocMemoryTest/NODEJS/RunTest.sh +0 -2
- package/samples/PDFDrawTest/NODEJS/PDFDrawTest.js +0 -306
- package/samples/PDFDrawTest/NODEJS/RunTest.sh +0 -2
- package/samples/PDFLayersTest/NODEJS/PDFLayersTest.js +0 -295
- package/samples/PDFLayersTest/NODEJS/RunTest.sh +0 -2
- package/samples/PDFPackageTest/NODEJS/PDFPackageTest.js +0 -112
- package/samples/PDFPackageTest/NODEJS/RunTest.sh +0 -2
- package/samples/PDFPageTest/NODEJS/PDFPageTest.js +0 -190
- package/samples/PDFPageTest/NODEJS/RunTest.sh +0 -2
- package/samples/PDFRedactTest/NODEJS/PDFRedactTest.js +0 -75
- package/samples/PDFRedactTest/NODEJS/RunTest.sh +0 -2
- package/samples/PageLabelsTest/NODEJS/PageLabelsTest.js +0 -139
- package/samples/PageLabelsTest/NODEJS/RunTest.sh +0 -2
- package/samples/PatternTest/NODEJS/PatternTest.js +0 -227
- package/samples/PatternTest/NODEJS/RunTest.sh +0 -2
- package/samples/RectTest/NODEJS/RectTest.js +0 -41
- package/samples/RectTest/NODEJS/RunTest.sh +0 -2
- package/samples/SDFTest/NODEJS/RunTest.sh +0 -2
- package/samples/SDFTest/NODEJS/SDFTest.js +0 -88
- package/samples/StamperTest/NODEJS/RunTest.sh +0 -2
- package/samples/StamperTest/NODEJS/StamperTest.js +0 -256
- package/samples/TextExtractTest/NODEJS/RunTest.sh +0 -2
- package/samples/TextExtractTest/NODEJS/TextExtractTest.js +0 -287
- package/samples/TextSearchTest/NODEJS/RunTest.sh +0 -2
- package/samples/TextSearchTest/NODEJS/TextSearchTest.js +0 -122
- package/samples/U3DTest/NODEJS/RunTest.sh +0 -2
- package/samples/U3DTest/NODEJS/U3DTest.js +0 -105
- package/samples/UndoRedoTest/NODEJS/RunTest.sh +0 -2
- package/samples/UndoRedoTest/NODEJS/UndoRedoTest.js +0 -101
- package/samples/UnicodeWriteTest/NODEJS/RunTest.sh +0 -2
- package/samples/UnicodeWriteTest/NODEJS/UnicodeWriteTest.js +0 -174
- package/samples/WebViewerConvertTest/NODEJS/RunTest.sh +0 -2
- package/samples/WebViewerConvertTest/NODEJS/WebViewerConvertTest.js +0 -136
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdftron/pdfnet-node-samples",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-3",
|
|
4
4
|
"description": "Sample code for the @pdftron/pdfnet-node package.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "run-script-os",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"test:win32": "cd samples && runall.bat",
|
|
9
9
|
"test:default": "echo '@pdftron/pdfnet-node doesn't support this platform.'"
|
|
10
10
|
},
|
|
11
|
-
"author": "
|
|
11
|
+
"author": "Apryse Software Inc.",
|
|
12
12
|
"license": "Commercial",
|
|
13
13
|
"homepage": "https://www.pdftron.com",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@pdftron/pdfnet-node": "
|
|
15
|
+
"@pdftron/pdfnet-node": "10.0.0-1",
|
|
16
16
|
"run-script-os": "^1.1.6"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 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
|
// The AdvancedImaging module is an optional PDFNet Add-on that can be used to convert AdvancedImaging
|
|
10
10
|
// documents into PDF documents
|
|
11
11
|
//
|
|
12
|
-
// The
|
|
12
|
+
// The Apryse SDK AdvancedImaging module can be downloaded from http://www.pdftron.com/
|
|
13
13
|
//---------------------------------------------------------------------------------------
|
|
14
14
|
|
|
15
15
|
const { PDFNet } = require('@pdftron/pdfnet-node');
|
|
@@ -26,7 +26,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
26
26
|
await PDFNet.addResourceSearchPath('../../lib/');
|
|
27
27
|
|
|
28
28
|
if (!await PDFNet.AdvancedImagingModule.isModuleAvailable()) {
|
|
29
|
-
console.log('\nUnable to run AdvancedImagingTest:
|
|
29
|
+
console.log('\nUnable to run AdvancedImagingTest: Apryse SDK AdvancedImaging module not available.');
|
|
30
30
|
console.log('---------------------------------------------------------------');
|
|
31
31
|
console.log('The AdvancedImaging module is an optional add-on, available for download');
|
|
32
32
|
console.log('at http://www.pdftron.com/. If you have already downloaded this');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 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
|
// The CAD module is an optional PDFNet Add-on that can be used to convert CAD
|
|
11
11
|
// documents into PDF documents
|
|
12
12
|
//
|
|
13
|
-
// The
|
|
13
|
+
// The Apryse SDK CAD module can be downloaded from http://www.pdftron.com/
|
|
14
14
|
//---------------------------------------------------------------------------------------
|
|
15
15
|
|
|
16
16
|
|
|
@@ -35,7 +35,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
35
35
|
try {
|
|
36
36
|
await PDFNet.addResourceSearchPath('../../lib/');
|
|
37
37
|
if (!(await PDFNet.CADModule.isModuleAvailable())) {
|
|
38
|
-
console.log('\nUnable to run CAD2PDFTest:
|
|
38
|
+
console.log('\nUnable to run CAD2PDFTest: Apryse SDK CAD module not available.');
|
|
39
39
|
console.log('---------------------------------------------------------------');
|
|
40
40
|
console.log('The CAD module is an optional add-on, available for download');
|
|
41
41
|
console.log('at http://www.pdftron.com/. If you have already downloaded this');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 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
|
// The Data Extraction suite is an optional PDFNet add-on collection that can be used to
|
|
8
8
|
// extract various types of data from PDF documents.
|
|
9
9
|
//
|
|
10
|
-
// The
|
|
10
|
+
// The Apryse SDK Data Extraction suite can be downloaded from http://www.pdftron.com/
|
|
11
11
|
//---------------------------------------------------------------------------------------
|
|
12
12
|
|
|
13
13
|
const fs = require('fs');
|
|
@@ -34,7 +34,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
34
34
|
|
|
35
35
|
// Test if the add-on is installed
|
|
36
36
|
if (!await PDFNet.DataExtractionModule.isModuleAvailable(PDFNet.DataExtractionModule.DataExtractionEngine.e_Tabular)) {
|
|
37
|
-
console.log('\nUnable to run Data Extraction:
|
|
37
|
+
console.log('\nUnable to run Data Extraction: Apryse SDK Tabular Data module not available.');
|
|
38
38
|
console.log('---------------------------------------------------------------');
|
|
39
39
|
console.log('The Data Extraction suite is an optional add-on, available for download');
|
|
40
40
|
console.log('at https://www.pdftron.com/documentation/core/info/modules/. If you have already');
|
|
@@ -67,7 +67,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
67
67
|
console.log('Extract tabular data as an XLSX file');
|
|
68
68
|
|
|
69
69
|
outputFile = outputPath + 'table.xlsx';
|
|
70
|
-
await PDFNet.DataExtractionModule.
|
|
70
|
+
await PDFNet.DataExtractionModule.extractToXLSX(inputPath + 'table.pdf', outputFile);
|
|
71
71
|
|
|
72
72
|
console.log('Result saved in ' + outputFile);
|
|
73
73
|
|
|
@@ -79,7 +79,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
79
79
|
const outputXlsxStream = await PDFNet.Filter.createMemoryFilter(0, false);
|
|
80
80
|
const options = new PDFNet.DataExtractionModule.DataExtractionOptions();
|
|
81
81
|
options.setPages("1"); // page 1
|
|
82
|
-
await PDFNet.DataExtractionModule.
|
|
82
|
+
await PDFNet.DataExtractionModule.extractToXLSXWithFilter(inputPath + 'financial.pdf', outputXlsxStream, options);
|
|
83
83
|
outputXlsxStream.memoryFilterSetAsInputFilter();
|
|
84
84
|
outputXlsxStream.writeToFile(outputFile, false);
|
|
85
85
|
|
|
@@ -95,7 +95,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
95
95
|
|
|
96
96
|
// Test if the add-on is installed
|
|
97
97
|
if (!await PDFNet.DataExtractionModule.isModuleAvailable(PDFNet.DataExtractionModule.DataExtractionEngine.e_DocStructure)) {
|
|
98
|
-
console.log('\nUnable to run Data Extraction:
|
|
98
|
+
console.log('\nUnable to run Data Extraction: Apryse SDK Structured Output module not available.');
|
|
99
99
|
console.log('---------------------------------------------------------------');
|
|
100
100
|
console.log('The Data Extraction suite is an optional add-on, available for download');
|
|
101
101
|
console.log('at https://www.pdftron.com/documentation/core/info/modules/. If you have already');
|
|
@@ -133,7 +133,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
133
133
|
|
|
134
134
|
// Test if the add-on is installed
|
|
135
135
|
if (!await PDFNet.DataExtractionModule.isModuleAvailable(PDFNet.DataExtractionModule.DataExtractionEngine.e_Form)) {
|
|
136
|
-
console.log('\nUnable to run Data Extraction:
|
|
136
|
+
console.log('\nUnable to run Data Extraction: Apryse SDK AIFormFieldExtractor module not available.');
|
|
137
137
|
console.log('---------------------------------------------------------------');
|
|
138
138
|
console.log('The Data Extraction suite is an optional add-on, available for download');
|
|
139
139
|
console.log('at https://www.pdftron.com/documentation/core/info/modules/. If you have already');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
//---------------------------------------------------------------------------------------
|
|
2
|
+
// Copyright (c) 2001-2023 by PDFTron Systems Inc. All Rights Reserved.
|
|
3
|
+
// Consult legal.txt regarding legal and license information.
|
|
4
|
+
//---------------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
const { PDFNet } = require('@pdftron/pdfnet-node');
|
|
7
|
+
const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
8
|
+
|
|
9
|
+
((exports) => {
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
exports.runDocumentCreationTest = () => {
|
|
13
|
+
|
|
14
|
+
const main = async () => {
|
|
15
|
+
|
|
16
|
+
const outputPath = '../TestFiles/Output/';
|
|
17
|
+
try {
|
|
18
|
+
const para_text =
|
|
19
|
+
"Lorem ipsum dolor " +
|
|
20
|
+
"sit amet, consectetur adipisicing elit, sed " +
|
|
21
|
+
"do eiusmod tempor incididunt ut labore " +
|
|
22
|
+
"et dolore magna aliqua. Ut enim ad " +
|
|
23
|
+
"minim veniam, quis nostrud exercitation " +
|
|
24
|
+
"ullamco laboris nisi ut aliquip ex ea " +
|
|
25
|
+
"commodo consequat. Duis aute irure " +
|
|
26
|
+
"dolor in reprehenderit in voluptate velit " +
|
|
27
|
+
"esse cillum dolore eu fugiat nulla pariatur. " +
|
|
28
|
+
"Excepteur sint occaecat cupidatat " +
|
|
29
|
+
"non proident, sunt in culpa qui officia " +
|
|
30
|
+
"deserunt mollit anim id est laborum.";
|
|
31
|
+
|
|
32
|
+
const flowdoc = await PDFNet.FlowDocument.create();
|
|
33
|
+
const para = await flowdoc.addParagraph();
|
|
34
|
+
|
|
35
|
+
para.setFontSize(24);
|
|
36
|
+
para.setTextColor(255, 0, 0);
|
|
37
|
+
para.addText("Start Red Text\n");
|
|
38
|
+
flowdoc.setDefaultMargins(0, 72.0, 144.0, 228.0);
|
|
39
|
+
flowdoc.setDefaultPageSize(650, 750);
|
|
40
|
+
flowdoc.addParagraphWithText(para_text);
|
|
41
|
+
|
|
42
|
+
for (var i = 0; i < 50; i++) {
|
|
43
|
+
const para = await flowdoc.addParagraph();
|
|
44
|
+
const point_size = (17*i*i*i)%13+5;
|
|
45
|
+
if (i % 2 == 0)
|
|
46
|
+
{
|
|
47
|
+
para.setItalic(true);
|
|
48
|
+
para.setTextColor(50, 50, 199);
|
|
49
|
+
para.setSpaceBefore(20);
|
|
50
|
+
para.setJustificationMode(PDFNet.ParagraphStyle.TextJustification.e_text_justify_left);
|
|
51
|
+
}
|
|
52
|
+
else
|
|
53
|
+
{
|
|
54
|
+
para.setTextColor(30, 199, 30);
|
|
55
|
+
para.setSpaceBefore(50);
|
|
56
|
+
para.setJustificationMode(PDFNet.ParagraphStyle.TextJustification.e_text_justify_right);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
para.addText(para_text);
|
|
60
|
+
para.setFontSize(point_size);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const my_pdf = await flowdoc.paginateToPDF();
|
|
64
|
+
my_pdf.save(outputPath + "created_doc.pdf", PDFNet.SDFDoc.SaveOptions.e_linearized);
|
|
65
|
+
console.log('Done.');
|
|
66
|
+
} catch (err) {
|
|
67
|
+
console.log(err);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
PDFNet.runWithCleanup(main, PDFTronLicense.Key).catch(function (error) {
|
|
72
|
+
console.log('Error: ' + JSON.stringify(error));
|
|
73
|
+
}).then(function () { return PDFNet.shutdown(); });
|
|
74
|
+
};
|
|
75
|
+
exports.runDocumentCreationTest();
|
|
76
|
+
})(exports);
|
|
77
|
+
// eslint-disable-next-line spaced-comment
|
|
78
|
+
//# sourceURL=DocumentCreationTest.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -39,7 +39,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
39
39
|
await PDFNet.HTML2PDF.setModulePath('../../lib/');
|
|
40
40
|
|
|
41
41
|
if(!(await PDFNet.HTML2PDF.isModuleAvailable())) {
|
|
42
|
-
console.log('Unable to run HTML2PDFTest:
|
|
42
|
+
console.log('Unable to run HTML2PDFTest: Apryse SDK HTML2PDF module not available.');
|
|
43
43
|
console.log('---------------------------------------------------------------');
|
|
44
44
|
console.log('The HTML2PDF module is an optional add-on, available for download');
|
|
45
45
|
console.log('at https://www.pdftron.com/. If you have already downloaded this');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2021 by
|
|
2
|
+
// Copyright (c) 2001-2021 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -21,7 +21,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
21
21
|
|
|
22
22
|
const useIRIS = await PDFNet.OCRModule.isIRISModuleAvailable();
|
|
23
23
|
if (!(await PDFNet.OCRModule.isModuleAvailable())) {
|
|
24
|
-
console.log('\nUnable to run OCRTest:
|
|
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
27
|
console.log('at http://www.pdftron.com/. If you have already downloaded this');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 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
|
// 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
|
|
16
|
+
// The Apryse SDK Structured Output module can be downloaded from
|
|
17
17
|
// https://www.pdftron.com/documentation/core/info/modules/
|
|
18
18
|
//
|
|
19
19
|
// Please contact us if you have any questions.
|
|
@@ -53,7 +53,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
53
53
|
await PDFNet.addResourceSearchPath('../../lib/');
|
|
54
54
|
|
|
55
55
|
if (!await PDFNet.StructuredOutputModule.isModuleAvailable()) {
|
|
56
|
-
console.log('\nUnable to run part of the sample:
|
|
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
59
|
console.log('at https://www.pdftron.com/documentation/core/info/modules/. If you have already');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 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
|
// 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
|
|
13
|
+
// The Apryse SDK Structured Output module can be downloaded from
|
|
14
14
|
// https://www.pdftron.com/documentation/core/info/modules/
|
|
15
15
|
//
|
|
16
16
|
// Please contact us if you have any questions.
|
|
@@ -34,7 +34,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
34
34
|
await PDFNet.addResourceSearchPath('../../lib/');
|
|
35
35
|
|
|
36
36
|
if (!await PDFNet.StructuredOutputModule.isModuleAvailable()) {
|
|
37
|
-
console.log('\nUnable to run the sample:
|
|
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
40
|
console.log('at https://www.pdftron.com/documentation/core/info/modules/. If you have already');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-2023 by
|
|
2
|
+
// Copyright (c) 2001-2023 by Apryse Software Inc. All Rights Reserved.
|
|
3
3
|
// Consult legal.txt regarding legal and license information.
|
|
4
4
|
//---------------------------------------------------------------------------------------
|
|
5
5
|
|