@pdftron/pdfnet-node-samples 9.4.2 → 9.5.0-2-beta-1
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 +18 -18
- package/readme.md +12 -12
- package/samples/AddImageTest/AddImageTest.js +2 -2
- package/samples/AdvancedImagingTest/AdvancedImagingTest.js +3 -3
- package/samples/AnnotationTest/AnnotationTest.js +2 -2
- package/samples/BookmarkTest/BookmarkTest.js +2 -2
- package/samples/CAD2PDFTest/CAD2PDFTest.js +79 -79
- package/samples/ContentReplacerTest/ContentReplacerTest.js +2 -2
- package/samples/ConvertTest/ConvertTest.js +270 -256
- package/samples/DataExtractionTest/DataExtractionTest.js +180 -0
- package/samples/DigitalSignaturesTest/DigitalSignaturesTest.js +526 -526
- package/samples/ElementBuilderTest/ElementBuilderTest.js +2 -2
- package/samples/ElementEditTest/ElementEditTest.js +2 -2
- package/samples/ElementReaderAdvTest/ElementReaderAdvTest.js +2 -2
- package/samples/ElementReaderTest/ElementReaderTest.js +2 -2
- package/samples/EncTest/EncTest.js +2 -2
- package/samples/FDFTest/FDFTest.js +218 -218
- package/samples/HTML2PDFTest/HTML2PDFTest.js +165 -165
- package/samples/HighlightsTest/HighlightsTest.js +2 -2
- package/samples/ImageExtractTest/ImageExtractTest.js +129 -129
- package/samples/ImpositionTest/ImpositionTest.js +86 -86
- package/samples/InteractiveFormsTest/InteractiveFormsTest.js +381 -381
- package/samples/JBIG2Test/JBIG2Test.js +88 -88
- package/samples/LogicalStructureTest/LogicalStructureTest.js +2 -2
- package/samples/OCRTest/OCRTest.js +234 -234
- package/samples/OfficeTemplateTest/OfficeTemplateTest.js +79 -77
- package/samples/OfficeToPDFTest/OfficeToPDFTest.js +125 -125
- package/samples/OptimizerTest/OptimizerTest.js +191 -191
- package/samples/PDF2HtmlTest/PDF2HtmlTest.js +3 -3
- package/samples/PDF2OfficeTest/PDF2OfficeTest.js +3 -3
- package/samples/PDFATest/PDFATest.js +2 -2
- package/samples/PDFDocMemoryTest/PDFDocMemoryTest.js +84 -84
- package/samples/PDFDrawTest/PDFDrawTest.js +2 -2
- package/samples/PDFLayersTest/PDFLayersTest.js +2 -2
- package/samples/PDFPackageTest/PDFPackageTest.js +111 -111
- package/samples/PDFPageTest/PDFPageTest.js +2 -2
- package/samples/PDFRedactTest/PDFRedactTest.js +2 -2
- package/samples/PageLabelsTest/PageLabelsTest.js +138 -138
- package/samples/PatternTest/PatternTest.js +226 -226
- package/samples/RectTest/RectTest.js +2 -2
- package/samples/SDFTest/SDFTest.js +3 -4
- package/samples/StamperTest/StamperTest.js +2 -2
- package/samples/TextExtractTest/TextExtractTest.js +2 -2
- package/samples/TextSearchTest/TextSearchTest.js +2 -2
- package/samples/U3DTest/U3DTest.js +104 -104
- package/samples/UndoRedoTest/UndoRedoTest.js +2 -2
- package/samples/UnicodeWriteTest/UnicodeWriteTest.js +2 -2
- package/samples/WebViewerConvertTest/WebViewerConvertTest.js +135 -135
- package/samples/runall.bat +6 -5
- package/samples/runall.sh +4 -5
- package/samples/TestFiles/BusinessCardTemplate.pdf +0 -0
- package/samples/TestFiles/Fishermen.docx +0 -0
- package/samples/TestFiles/Font_licenses.txt +0 -140
- package/samples/TestFiles/GlobalSignRootForTST.cer +0 -0
- package/samples/TestFiles/License.txt +0 -1
- package/samples/TestFiles/Misc-Fixed.pfa +0 -1166
- package/samples/TestFiles/NotoSans_with_hindi.ttf +0 -0
- package/samples/TestFiles/Output/empty +0 -1
- package/samples/TestFiles/SHA-2 Root USERTrust RSA CA Sectigo timestamping.crt +0 -34
- package/samples/TestFiles/SYH_Letter.docx +0 -0
- package/samples/TestFiles/TigerText.pdf +0 -0
- package/samples/TestFiles/US061222892-a.pdf +0 -0
- package/samples/TestFiles/butterfly.png +0 -0
- package/samples/TestFiles/credit card numbers.pdf +0 -0
- package/samples/TestFiles/dice.jpg +0 -0
- package/samples/TestFiles/dice.u3d +0 -0
- package/samples/TestFiles/doc_to_sign.pdf +0 -0
- package/samples/TestFiles/factsheet_Arabic.docx +0 -0
- package/samples/TestFiles/fish.pdf +0 -0
- package/samples/TestFiles/font.ttf +0 -0
- package/samples/TestFiles/form1.pdf +1 -245
- package/samples/TestFiles/form1_annots.xfdf +0 -34
- package/samples/TestFiles/form1_data.fdf +0 -4
- package/samples/TestFiles/form1_data.xfdf +0 -140
- package/samples/TestFiles/grayscale.tif +0 -0
- package/samples/TestFiles/hindi_sample_utf16le.txt +0 -0
- package/samples/TestFiles/imagemask.dat +0 -32
- package/samples/TestFiles/logo_red.png +0 -0
- package/samples/TestFiles/lorem_ipsum.pdf +0 -0
- package/samples/TestFiles/multipage.tif +0 -0
- package/samples/TestFiles/my_stream.txt +0 -2310
- package/samples/TestFiles/newsletter.pdf +0 -0
- package/samples/TestFiles/newsletter.xod +0 -0
- package/samples/TestFiles/numbered.pdf +0 -0
- package/samples/TestFiles/op_blend_test.pdf +0 -1498
- package/samples/TestFiles/palm.jp2 +0 -0
- package/samples/TestFiles/paragraphs_and_tables.pdf +0 -0
- package/samples/TestFiles/pdfnet.gif +0 -0
- package/samples/TestFiles/pdftron.bmp +0 -0
- package/samples/TestFiles/pdftron.cer +0 -0
- package/samples/TestFiles/pdftron.pfx +0 -0
- package/samples/TestFiles/pdftron_smart_substitution.plugin +0 -0
- package/samples/TestFiles/peppers.jpg +0 -0
- package/samples/TestFiles/signature.jpg +0 -0
- package/samples/TestFiles/simple-emf.emf +0 -0
- package/samples/TestFiles/simple-excel_2007.xlsx +0 -0
- package/samples/TestFiles/simple-outlook.msg +0 -0
- package/samples/TestFiles/simple-powerpoint_2007.pptx +0 -0
- package/samples/TestFiles/simple-publisher.pub +0 -0
- package/samples/TestFiles/simple-rtf.rtf +0 -224
- package/samples/TestFiles/simple-text.txt +0 -61
- package/samples/TestFiles/simple-visio.vsd +0 -0
- package/samples/TestFiles/simple-webpage.html +0 -731
- package/samples/TestFiles/simple-webpage.mht +0 -6972
- package/samples/TestFiles/simple-webpage_files/colorschememapping.xml +0 -2
- package/samples/TestFiles/simple-webpage_files/filelist.xml +0 -14
- package/samples/TestFiles/simple-webpage_files/image001.gif +0 -0
- package/samples/TestFiles/simple-webpage_files/image002.png +0 -0
- package/samples/TestFiles/simple-webpage_files/image003.jpg +0 -0
- package/samples/TestFiles/simple-webpage_files/image004.emz +0 -0
- package/samples/TestFiles/simple-webpage_files/image005.gif +0 -0
- package/samples/TestFiles/simple-webpage_files/image006.png +0 -0
- package/samples/TestFiles/simple-webpage_files/image007.gif +0 -0
- package/samples/TestFiles/simple-webpage_files/oledata.mso +0 -0
- package/samples/TestFiles/simple-webpage_files/themedata.thmx +0 -0
- package/samples/TestFiles/simple-word_2007.docx +0 -0
- package/samples/TestFiles/simple-xps.xps +0 -0
- package/samples/TestFiles/tagged.pdf +0 -0
- package/samples/TestFiles/the_rime_of_the_ancient_mariner.docx +0 -0
- package/samples/TestFiles/tiger.pdf +0 -0
- package/samples/TestFiles/waiver.pdf +0 -0
- package/samples/TestFiles/waiver_withApprovalField.pdf +0 -0
- package/samples/TestFiles/waiver_withApprovalField_certified.pdf +1 -424
- package/samples/TestFiles/waiver_withApprovalField_certified_approved.pdf +1 -466
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-
|
|
3
|
-
// Consult legal.txt regarding legal and license information.
|
|
4
|
-
//---------------------------------------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
//-----------------------------------------------------------------------------------
|
|
7
|
-
// The sample illustrates how to work with PDF page labels.
|
|
8
|
-
//
|
|
9
|
-
// PDF page labels can be used to describe a page. This is used to
|
|
10
|
-
// allow for non-sequential page numbering or the addition of arbitrary
|
|
11
|
-
// labels for a page (such as the inclusion of Roman numerals at the
|
|
12
|
-
// beginning of a book). PDFNet PageLabel object can be used to specify
|
|
13
|
-
// the numbering style to use (for example, upper- or lower-case Roman,
|
|
14
|
-
// decimal, and so forth), the starting number for the first page,
|
|
15
|
-
// and an arbitrary prefix to be pre-appended to each number (for
|
|
16
|
-
// example, 'A-' to generate 'A-1', 'A-2', 'A-3', and so forth.)
|
|
17
|
-
//-----------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const { PDFNet } = require('
|
|
20
|
-
const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
21
|
-
|
|
22
|
-
((exports) => {
|
|
23
|
-
'use strict';
|
|
24
|
-
|
|
25
|
-
exports.runPageLabelsTest = () => {
|
|
26
|
-
const main = async () => {
|
|
27
|
-
const inputPath = '../TestFiles/';
|
|
28
|
-
const outputPath = inputPath + 'Output/';
|
|
29
|
-
const outputFile = outputPath + 'newsletter_with_pagelabels.pdf';
|
|
30
|
-
|
|
31
|
-
try {
|
|
32
|
-
//-----------------------------------------------------------
|
|
33
|
-
// Example 1: Add page labels to an existing or newly created PDF
|
|
34
|
-
// document.
|
|
35
|
-
//-----------------------------------------------------------
|
|
36
|
-
{
|
|
37
|
-
const doc = await PDFNet.PDFDoc.createFromFilePath(inputPath + 'newsletter.pdf');
|
|
38
|
-
doc.initSecurityHandler();
|
|
39
|
-
|
|
40
|
-
// Create a page labeling scheme that starts with the first page in
|
|
41
|
-
// the document (page 1) and is using uppercase roman numbering
|
|
42
|
-
// style.
|
|
43
|
-
const L1 = await PDFNet.PageLabel.create(doc, PDFNet.PageLabel.Style.e_roman_uppercase, 'My Prefix ', 1);
|
|
44
|
-
doc.setPageLabel(1, L1);
|
|
45
|
-
|
|
46
|
-
// Create a page labeling scheme that starts with the fourth page in
|
|
47
|
-
// the document and is using decimal Arabic numbering style.
|
|
48
|
-
// Also the numeric portion of the first label should start with number
|
|
49
|
-
// 4 (otherwise the first label would be 'My Prefix 1').
|
|
50
|
-
const L2 = await PDFNet.PageLabel.create(doc, PDFNet.PageLabel.Style.e_decimal, 'My Prefix ', 4);
|
|
51
|
-
doc.setPageLabel(4, L2);
|
|
52
|
-
|
|
53
|
-
// Create a page labeling scheme that starts with the seventh page in
|
|
54
|
-
// the document and is using alphabetic numbering style. The numeric
|
|
55
|
-
// portion of the first label should start with number 1.
|
|
56
|
-
const L3 = await PDFNet.PageLabel.create(doc, PDFNet.PageLabel.Style.e_alphabetic_uppercase, 'My Prefix ', 1);
|
|
57
|
-
doc.setPageLabel(7, L3);
|
|
58
|
-
|
|
59
|
-
doc.save(outputFile, PDFNet.SDFDoc.SaveOptions.e_linearized);
|
|
60
|
-
console.log('Done. Result saved in newsletter_with_pagelabels.pdf...');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
//-----------------------------------------------------------
|
|
64
|
-
// Example 2: Read page labels from an existing PDF document.
|
|
65
|
-
//-----------------------------------------------------------
|
|
66
|
-
{
|
|
67
|
-
const doc = await PDFNet.PDFDoc.createFromFilePath(outputFile);
|
|
68
|
-
doc.initSecurityHandler();
|
|
69
|
-
|
|
70
|
-
const page_num = await doc.getPageCount();
|
|
71
|
-
for (let i = 1; i <= page_num; ++i) {
|
|
72
|
-
console.log('Page number: ' + i);
|
|
73
|
-
const label = await doc.getPageLabel(i);
|
|
74
|
-
if (await label.isValid()) {
|
|
75
|
-
console.log(' Label: ' + await label.getLabelTitle(i));
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
console.log(' No Label.');
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
//-----------------------------------------------------------
|
|
84
|
-
// Example 3: Modify page labels from an existing PDF document.
|
|
85
|
-
//-----------------------------------------------------------
|
|
86
|
-
{
|
|
87
|
-
const doc = await PDFNet.PDFDoc.createFromFilePath(outputFile);
|
|
88
|
-
doc.initSecurityHandler();
|
|
89
|
-
|
|
90
|
-
// Remove the alphabetic labels from example 1.
|
|
91
|
-
doc.removePageLabel(7);
|
|
92
|
-
|
|
93
|
-
// Replace the Prefix in the decimal labels (from example 1).
|
|
94
|
-
const label = await doc.getPageLabel(4);
|
|
95
|
-
if (await label.isValid()) {
|
|
96
|
-
await label.setPrefix('A');
|
|
97
|
-
label.setStart(1);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Add a new label
|
|
101
|
-
const new_label = await PDFNet.PageLabel.create(doc, PDFNet.PageLabel.Style.e_decimal, 'B', 1);
|
|
102
|
-
doc.setPageLabel(10, new_label); // starting from page 10.
|
|
103
|
-
|
|
104
|
-
doc.save(outputPath + 'newsletter_with_pagelabels_modified.pdf', PDFNet.SDFDoc.SaveOptions.e_linearized);
|
|
105
|
-
console.log('Done. Result saved in newsletter_with_pagelabels_modified.pdf...');
|
|
106
|
-
|
|
107
|
-
const page_num = await doc.getPageCount();
|
|
108
|
-
for (let i = 1; i <= page_num; ++i) {
|
|
109
|
-
console.log('Page number: ' + i);
|
|
110
|
-
const label = await doc.getPageLabel(i);
|
|
111
|
-
if (await label.isValid()) {
|
|
112
|
-
console.log(' Label: ' + await label.getLabelTitle(i));
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
console.log(' No Label.');
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
//-----------------------------------------------------------
|
|
121
|
-
// Example 4: Delete all page labels in an existing PDF document.
|
|
122
|
-
//-----------------------------------------------------------
|
|
123
|
-
{
|
|
124
|
-
const doc = await PDFNet.PDFDoc.createFromFilePath(outputFile);
|
|
125
|
-
(await doc.getRoot()).eraseFromKey('PageLabels');
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
} catch (err) {
|
|
129
|
-
console.log(err);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
PDFNet.runWithCleanup(main, PDFTronLicense.Key).catch(function(error) {
|
|
133
|
-
console.log('Error: ' + JSON.stringify(error));
|
|
134
|
-
}).then(function(){ return PDFNet.shutdown(); });
|
|
135
|
-
};
|
|
136
|
-
exports.runPageLabelsTest();
|
|
137
|
-
})(exports);
|
|
138
|
-
// eslint-disable-next-line spaced-comment
|
|
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
|
+
//-----------------------------------------------------------------------------------
|
|
7
|
+
// The sample illustrates how to work with PDF page labels.
|
|
8
|
+
//
|
|
9
|
+
// PDF page labels can be used to describe a page. This is used to
|
|
10
|
+
// allow for non-sequential page numbering or the addition of arbitrary
|
|
11
|
+
// labels for a page (such as the inclusion of Roman numerals at the
|
|
12
|
+
// beginning of a book). PDFNet PageLabel object can be used to specify
|
|
13
|
+
// the numbering style to use (for example, upper- or lower-case Roman,
|
|
14
|
+
// decimal, and so forth), the starting number for the first page,
|
|
15
|
+
// and an arbitrary prefix to be pre-appended to each number (for
|
|
16
|
+
// example, 'A-' to generate 'A-1', 'A-2', 'A-3', and so forth.)
|
|
17
|
+
//-----------------------------------------------------------------------------------
|
|
18
|
+
|
|
19
|
+
const { PDFNet } = require('../lib/pdfnet.js');
|
|
20
|
+
const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
21
|
+
|
|
22
|
+
((exports) => {
|
|
23
|
+
'use strict';
|
|
24
|
+
|
|
25
|
+
exports.runPageLabelsTest = () => {
|
|
26
|
+
const main = async () => {
|
|
27
|
+
const inputPath = '../TestFiles/';
|
|
28
|
+
const outputPath = inputPath + 'Output/';
|
|
29
|
+
const outputFile = outputPath + 'newsletter_with_pagelabels.pdf';
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
//-----------------------------------------------------------
|
|
33
|
+
// Example 1: Add page labels to an existing or newly created PDF
|
|
34
|
+
// document.
|
|
35
|
+
//-----------------------------------------------------------
|
|
36
|
+
{
|
|
37
|
+
const doc = await PDFNet.PDFDoc.createFromFilePath(inputPath + 'newsletter.pdf');
|
|
38
|
+
doc.initSecurityHandler();
|
|
39
|
+
|
|
40
|
+
// Create a page labeling scheme that starts with the first page in
|
|
41
|
+
// the document (page 1) and is using uppercase roman numbering
|
|
42
|
+
// style.
|
|
43
|
+
const L1 = await PDFNet.PageLabel.create(doc, PDFNet.PageLabel.Style.e_roman_uppercase, 'My Prefix ', 1);
|
|
44
|
+
doc.setPageLabel(1, L1);
|
|
45
|
+
|
|
46
|
+
// Create a page labeling scheme that starts with the fourth page in
|
|
47
|
+
// the document and is using decimal Arabic numbering style.
|
|
48
|
+
// Also the numeric portion of the first label should start with number
|
|
49
|
+
// 4 (otherwise the first label would be 'My Prefix 1').
|
|
50
|
+
const L2 = await PDFNet.PageLabel.create(doc, PDFNet.PageLabel.Style.e_decimal, 'My Prefix ', 4);
|
|
51
|
+
doc.setPageLabel(4, L2);
|
|
52
|
+
|
|
53
|
+
// Create a page labeling scheme that starts with the seventh page in
|
|
54
|
+
// the document and is using alphabetic numbering style. The numeric
|
|
55
|
+
// portion of the first label should start with number 1.
|
|
56
|
+
const L3 = await PDFNet.PageLabel.create(doc, PDFNet.PageLabel.Style.e_alphabetic_uppercase, 'My Prefix ', 1);
|
|
57
|
+
doc.setPageLabel(7, L3);
|
|
58
|
+
|
|
59
|
+
doc.save(outputFile, PDFNet.SDFDoc.SaveOptions.e_linearized);
|
|
60
|
+
console.log('Done. Result saved in newsletter_with_pagelabels.pdf...');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
//-----------------------------------------------------------
|
|
64
|
+
// Example 2: Read page labels from an existing PDF document.
|
|
65
|
+
//-----------------------------------------------------------
|
|
66
|
+
{
|
|
67
|
+
const doc = await PDFNet.PDFDoc.createFromFilePath(outputFile);
|
|
68
|
+
doc.initSecurityHandler();
|
|
69
|
+
|
|
70
|
+
const page_num = await doc.getPageCount();
|
|
71
|
+
for (let i = 1; i <= page_num; ++i) {
|
|
72
|
+
console.log('Page number: ' + i);
|
|
73
|
+
const label = await doc.getPageLabel(i);
|
|
74
|
+
if (await label.isValid()) {
|
|
75
|
+
console.log(' Label: ' + await label.getLabelTitle(i));
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
console.log(' No Label.');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//-----------------------------------------------------------
|
|
84
|
+
// Example 3: Modify page labels from an existing PDF document.
|
|
85
|
+
//-----------------------------------------------------------
|
|
86
|
+
{
|
|
87
|
+
const doc = await PDFNet.PDFDoc.createFromFilePath(outputFile);
|
|
88
|
+
doc.initSecurityHandler();
|
|
89
|
+
|
|
90
|
+
// Remove the alphabetic labels from example 1.
|
|
91
|
+
doc.removePageLabel(7);
|
|
92
|
+
|
|
93
|
+
// Replace the Prefix in the decimal labels (from example 1).
|
|
94
|
+
const label = await doc.getPageLabel(4);
|
|
95
|
+
if (await label.isValid()) {
|
|
96
|
+
await label.setPrefix('A');
|
|
97
|
+
label.setStart(1);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Add a new label
|
|
101
|
+
const new_label = await PDFNet.PageLabel.create(doc, PDFNet.PageLabel.Style.e_decimal, 'B', 1);
|
|
102
|
+
doc.setPageLabel(10, new_label); // starting from page 10.
|
|
103
|
+
|
|
104
|
+
doc.save(outputPath + 'newsletter_with_pagelabels_modified.pdf', PDFNet.SDFDoc.SaveOptions.e_linearized);
|
|
105
|
+
console.log('Done. Result saved in newsletter_with_pagelabels_modified.pdf...');
|
|
106
|
+
|
|
107
|
+
const page_num = await doc.getPageCount();
|
|
108
|
+
for (let i = 1; i <= page_num; ++i) {
|
|
109
|
+
console.log('Page number: ' + i);
|
|
110
|
+
const label = await doc.getPageLabel(i);
|
|
111
|
+
if (await label.isValid()) {
|
|
112
|
+
console.log(' Label: ' + await label.getLabelTitle(i));
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
console.log(' No Label.');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
//-----------------------------------------------------------
|
|
121
|
+
// Example 4: Delete all page labels in an existing PDF document.
|
|
122
|
+
//-----------------------------------------------------------
|
|
123
|
+
{
|
|
124
|
+
const doc = await PDFNet.PDFDoc.createFromFilePath(outputFile);
|
|
125
|
+
(await doc.getRoot()).eraseFromKey('PageLabels');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
} catch (err) {
|
|
129
|
+
console.log(err);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
PDFNet.runWithCleanup(main, PDFTronLicense.Key).catch(function(error) {
|
|
133
|
+
console.log('Error: ' + JSON.stringify(error));
|
|
134
|
+
}).then(function(){ return PDFNet.shutdown(); });
|
|
135
|
+
};
|
|
136
|
+
exports.runPageLabelsTest();
|
|
137
|
+
})(exports);
|
|
138
|
+
// eslint-disable-next-line spaced-comment
|
|
139
139
|
//# sourceURL=PageLabelsTest.js
|