@pdftron/pdfnet-node-samples 11.3.0-beta → 11.4.0
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/DataExtractionTest/DataExtractionTest.js +48 -3
- package/DigitalSignaturesTest/DigitalSignaturesTest.js +7 -7
- package/LicenseKey/LicenseKey.js +1 -1
- package/TestFiles/apryse.bmp +0 -0
- package/TestFiles/tagged_(en_to_fr).xlf +152 -0
- package/TransPDFTest/TransPDFTest.js +68 -0
- package/legal.txt +2 -2
- package/package.json +2 -2
- package/readme.md +1 -1
- package/TestFiles/pdftron.bmp +0 -0
- /package/TestFiles/{pdftron.cer → apryse.cer} +0 -0
- /package/TestFiles/{pdftron.pfx → apryse.pfx} +0 -0
|
@@ -78,7 +78,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
78
78
|
outputFile = outputPath + 'financial.xlsx';
|
|
79
79
|
const outputXlsxStream = await PDFNet.Filter.createMemoryFilter(0, false);
|
|
80
80
|
const options = new PDFNet.DataExtractionModule.DataExtractionOptions();
|
|
81
|
-
options.setPages(
|
|
81
|
+
options.setPages('1'); // page 1
|
|
82
82
|
await PDFNet.DataExtractionModule.extractToXLSXWithFilter(inputPath + 'financial.pdf', outputXlsxStream, options);
|
|
83
83
|
outputXlsxStream.memoryFilterSetAsInputFilter();
|
|
84
84
|
outputXlsxStream.writeToFile(outputFile, false);
|
|
@@ -167,7 +167,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
167
167
|
{
|
|
168
168
|
console.log('Detect and add form fields in a PDF file, keep new fields');
|
|
169
169
|
|
|
170
|
-
const doc = await PDFNet.PDFDoc.createFromFilePath(inputPath +
|
|
170
|
+
const doc = await PDFNet.PDFDoc.createFromFilePath(inputPath + 'formfields-scanned-withfields.pdf');
|
|
171
171
|
|
|
172
172
|
await PDFNet.DataExtractionModule.detectAndAddFormFieldsToPDF(doc);
|
|
173
173
|
outputFile = outputPath + 'formfields-scanned-fields-new.pdf';
|
|
@@ -182,7 +182,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
182
182
|
{
|
|
183
183
|
console.log('Detect and add form fields in a PDF file, keep old fields');
|
|
184
184
|
|
|
185
|
-
const doc = await PDFNet.PDFDoc.createFromFilePath(inputPath +
|
|
185
|
+
const doc = await PDFNet.PDFDoc.createFromFilePath(inputPath + 'formfields-scanned-withfields.pdf');
|
|
186
186
|
|
|
187
187
|
const options = new PDFNet.DataExtractionModule.DataExtractionOptions();
|
|
188
188
|
options.setOverlappingFormFieldBehavior('KeepOld');
|
|
@@ -199,6 +199,51 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
//////////////////////////////////////////////////////////////////////////
|
|
203
|
+
// The following sample illustrates how to extract key-value pairs from PDF documents.
|
|
204
|
+
//////////////////////////////////////////////////////////////////////////
|
|
205
|
+
if (!await PDFNet.DataExtractionModule.isModuleAvailable(PDFNet.DataExtractionModule.DataExtractionEngine.e_GenericKeyValue)) {
|
|
206
|
+
console.log();
|
|
207
|
+
console.log('Unable to run Data Extraction: Apryse SDK AIPageObjectExtractor module not available.');
|
|
208
|
+
console.log('---------------------------------------------------------------');
|
|
209
|
+
console.log('The Data Extraction suite is an optional add-on, available for download');
|
|
210
|
+
console.log('at http://www.pdftron.com/. If you have already downloaded this');
|
|
211
|
+
console.log('module, ensure that the SDK is able to find the required files');
|
|
212
|
+
console.log('using the PDFNet.addResourceSearchPath() function.');
|
|
213
|
+
console.log();
|
|
214
|
+
}
|
|
215
|
+
else
|
|
216
|
+
{
|
|
217
|
+
try {
|
|
218
|
+
// Simple example: Extract Keys & Values as a JSON file
|
|
219
|
+
console.log('Extract Key-Value pairs as a JSON file');
|
|
220
|
+
await PDFNet.DataExtractionModule.extractData(inputPath + 'newsletter.pdf', outputPath + 'newsletter_key_val.json', PDFNet.DataExtractionModule.DataExtractionEngine.e_GenericKeyValue);
|
|
221
|
+
console.log('Result saved in ' + outputPath + 'newsletter_key_val.json');
|
|
222
|
+
|
|
223
|
+
const options = new PDFNet.DataExtractionModule.DataExtractionOptions();
|
|
224
|
+
options.setPages('2-4');
|
|
225
|
+
|
|
226
|
+
const p2ExclusionZones = [];
|
|
227
|
+
// Exclude the ad on page 2
|
|
228
|
+
// These coordinates are in PDF user space, with the origin at the bottom left corner of the page
|
|
229
|
+
// Coordinates rotate with the page, if it has rotation applied.
|
|
230
|
+
p2ExclusionZones.push(new PDFNet.Rect(166, 47, 562, 222));
|
|
231
|
+
options.addExclusionZonesForPage(p2ExclusionZones, 2);
|
|
232
|
+
|
|
233
|
+
const p4InclusionZones = [];
|
|
234
|
+
const p4ExclusionZones = [];
|
|
235
|
+
// Only include the article text for page 4, exclude ads and headings
|
|
236
|
+
p4InclusionZones.push(new PDFNet.Rect(30, 432, 562, 684));
|
|
237
|
+
p4ExclusionZones.push(new PDFNet.Rect(30, 657, 295, 684));
|
|
238
|
+
options.addInclusionZonesForPage(p4InclusionZones, 4);
|
|
239
|
+
options.addExclusionZonesForPage(p4ExclusionZones, 4);
|
|
240
|
+
console.log('Extract Key-Value pairs from specific pages and zones as a JSON file');
|
|
241
|
+
await PDFNet.DataExtractionModule.extractData(inputPath + 'newsletter.pdf', outputPath + 'newsletter_key_val_with_zones.json', PDFNet.DataExtractionModule.DataExtractionEngine.e_GenericKeyValue, options);
|
|
242
|
+
console.log('Result saved in ' + outputPath + 'newsletter_key_val_with_zones.json');
|
|
243
|
+
} catch (err) {
|
|
244
|
+
console.log(err);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
202
247
|
//////////////////////////////////////////////////////////////////////////
|
|
203
248
|
|
|
204
249
|
console.log('Done.');
|
|
@@ -513,9 +513,9 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
513
513
|
try {
|
|
514
514
|
await CertifyPDF(input_path + 'waiver_withApprovalField.pdf',
|
|
515
515
|
'PDFTronCertificationSig',
|
|
516
|
-
input_path + '
|
|
516
|
+
input_path + 'apryse.pfx',
|
|
517
517
|
'password',
|
|
518
|
-
input_path + '
|
|
518
|
+
input_path + 'apryse.bmp',
|
|
519
519
|
output_path + 'waiver_withApprovalField_certified_output.pdf');
|
|
520
520
|
await PrintSignaturesInfo(output_path + 'waiver_withApprovalField_certified_output.pdf');
|
|
521
521
|
} catch (err) {
|
|
@@ -527,7 +527,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
527
527
|
try {
|
|
528
528
|
await SignPDF(input_path + 'waiver_withApprovalField_certified.pdf',
|
|
529
529
|
'PDFTronApprovalSig',
|
|
530
|
-
input_path + '
|
|
530
|
+
input_path + 'apryse.pfx',
|
|
531
531
|
'password',
|
|
532
532
|
input_path + 'signature.jpg',
|
|
533
533
|
output_path + 'waiver_withApprovalField_certified_approved_output.pdf');
|
|
@@ -551,7 +551,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
551
551
|
//////////////////// TEST 4: Verify a document's digital signatures.
|
|
552
552
|
// EXPERIMENTAL. Digital signature verification is undergoing active development, but currently does not support a number of features. If we are missing a feature that is important to you, or if you have files that do not act as expected, please contact us using one of the following forms: https://apryse.com/form/trial-support or https://apryse.com/form/request
|
|
553
553
|
try {
|
|
554
|
-
if (!(await VerifyAllAndPrint(input_path + 'waiver_withApprovalField_certified_approved.pdf', input_path + '
|
|
554
|
+
if (!(await VerifyAllAndPrint(input_path + 'waiver_withApprovalField_certified_approved.pdf', input_path + 'apryse.cer'))) {
|
|
555
555
|
ret = 1;
|
|
556
556
|
}
|
|
557
557
|
} catch (err) {
|
|
@@ -561,7 +561,7 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
561
561
|
|
|
562
562
|
//////////////////// TEST 5: Verify a document's digital signatures in a simple fashion using the document API.
|
|
563
563
|
try {
|
|
564
|
-
if (!(await VerifySimple(input_path + 'waiver_withApprovalField_certified_approved.pdf', input_path + '
|
|
564
|
+
if (!(await VerifySimple(input_path + 'waiver_withApprovalField_certified_approved.pdf', input_path + 'apryse.cer'))) {
|
|
565
565
|
ret = 1;
|
|
566
566
|
}
|
|
567
567
|
} catch (err) {
|
|
@@ -578,9 +578,9 @@ const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
|
578
578
|
try {
|
|
579
579
|
await CustomSigningAPI(input_path + 'waiver.pdf',
|
|
580
580
|
'PDFTronCertificationSig',
|
|
581
|
-
input_path + '
|
|
581
|
+
input_path + 'apryse.pfx',
|
|
582
582
|
'password',
|
|
583
|
-
input_path + '
|
|
583
|
+
input_path + 'apryse.cer',
|
|
584
584
|
input_path + 'signature.jpg',
|
|
585
585
|
PDFNet.DigestAlgorithm.Type.e_SHA256,
|
|
586
586
|
true,
|
package/LicenseKey/LicenseKey.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//---------------------------------------------------------------------------------------
|
|
2
|
-
// Copyright (c) 2001-
|
|
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
|
|
|
Binary file
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
|
|
3
|
+
<file original="" source-language="en-us" target-language="es-es" datatype="x-pdf" product-name="InfixXLIFF">
|
|
4
|
+
<header>
|
|
5
|
+
<tool tool-id="InfixXLIFF" tool-name="InfixXLIFF" tool-company="Apryse"/>
|
|
6
|
+
</header>
|
|
7
|
+
<body>
|
|
8
|
+
<!--
|
|
9
|
+
<cstyle id="1-0" name="0" size="10.0" rise="0.0" scale="100"
|
|
10
|
+
colour="0" colid="0" fname="Calibri" fweight="normal" fstyle="normal"
|
|
11
|
+
underline="0" link=""/>
|
|
12
|
+
-->
|
|
13
|
+
<trans-unit id='p1' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
14
|
+
<source>PDFNet SDK is an amazingly comprehensive, high-quality PDF developer toolkit for working with PDF files at all levels. Using the PDFNet PDF library, developers can flexibly implement and create powerful PDF solutions and applications that can generate, manipulate, view, render and print PDF documents without any third-party software dependencies. </source>
|
|
15
|
+
<target>PDFNet SDK est une boîte à outils de développement PDF incroyablement complète et de haute qualité pour travailler avec des fichiers PDF à tous les niveaux. À l’aide de la bibliothèque PDF PDFNet, les développeurs peuvent mettre en œuvre et créer de manière flexible des solutions et des applications PDF puissantes capables de générer, manipuler, visualiser, rendre et imprimer des documents PDF sans aucune dépendance logicielle tierce. </target>
|
|
16
|
+
</trans-unit>
|
|
17
|
+
|
|
18
|
+
<!--
|
|
19
|
+
<cstyle id="2-0" name="0" size="10.0" rise="0.0" scale="100"
|
|
20
|
+
colour="0" colid="0" fname="Calibri" fweight="normal" fstyle="normal"
|
|
21
|
+
underline="0" link=""/>
|
|
22
|
+
-->
|
|
23
|
+
<trans-unit id='p2' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
24
|
+
<source>PDFNet SDK is available as a 100% .NET component that can be used from any .NET language (e.g. C#, VB.NET) and as a cross-platform C/C++ PDF library available on a wide range of platforms (i.e. Windows, Linux, Mac OS X, etc). </source>
|
|
25
|
+
<target>Le Kit de développement logiciel (SDK) PDFNet est disponible en tant que composant 100 % .NET qui peut être utilisé à partir de n’importe quel langage .NET (par exemple, C#, VB.NET) et en tant que bibliothèque PDF C/C++ multiplateforme disponible sur un large éventail de plates-formes (c’est-à-dire Windows, Linux, Mac OS X, etc.). </target>
|
|
26
|
+
</trans-unit>
|
|
27
|
+
|
|
28
|
+
<!--
|
|
29
|
+
<cstyle id="3-0" name="0" size="16.0" rise="0.0" scale="100"
|
|
30
|
+
colour="4f81bd" colid="1" fname="CalibriBold" fweight="bold" fstyle="normal"
|
|
31
|
+
underline="0" link=""/>
|
|
32
|
+
|
|
33
|
+
<cstyle id="3-1" name="1" size="13.0" rise="0.0" scale="100"
|
|
34
|
+
colour="4f81bd" colid="1" fname="CalibriBold" fweight="bold" fstyle="normal"
|
|
35
|
+
underline="0" link=""/>
|
|
36
|
+
-->
|
|
37
|
+
<trans-unit id='p3' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
38
|
+
<source>C<g id='3-1' ctype='x-cstyle'>OMMON </g>U<g id='3-1' ctype='x-cstyle'>SE </g>C<g id='3-1' ctype='x-cstyle'>ASE </g>S<g id='3-1' ctype='x-cstyle'>CENARIOS </g></source>
|
|
39
|
+
<target>S<g id='3-1' ctype='x-cstyle'>CÉNARIOS DE </g>C<g id='3-1' ctype='x-cstyle'>AS </g>D<g id='3-1' ctype='x-cstyle'>'UTILISATION </g>C<g id='3-1' ctype='x-cstyle'>OURANTS </g></target>
|
|
40
|
+
</trans-unit>
|
|
41
|
+
|
|
42
|
+
<!--
|
|
43
|
+
<cstyle id="4-0" name="0" size="10.0" rise="0.0" scale="100"
|
|
44
|
+
colour="0" colid="0" fname="Calibri" fweight="normal" fstyle="normal"
|
|
45
|
+
underline="0" link=""/>
|
|
46
|
+
-->
|
|
47
|
+
<trans-unit id='p4' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
48
|
+
<source>With built-in multi-threading, unparalleled reliability, native code efficiency and high security, PDFNet SDK is the ideal PDF software developer toolkit for high-volume, scalable solutions in the areas of content extraction, indexing, searching, forms, pre-press workflows, web-services, document archival, and document and content management. </source>
|
|
49
|
+
<target>Avec un multi-threading intégré, une fiabilité inégalée, une efficacité de code natif et une sécurité élevée, PDFNet SDK est la boîte à outils idéale pour les développeurs de logiciels PDF pour les solutions évolutives à haut volume dans les domaines de l’extraction de contenu, de l’indexation, de la recherche, des formulaires, des flux de travail prépresse, des services Web, de l’archivage de documents et de la gestion de documents et de contenu. </target>
|
|
50
|
+
</trans-unit>
|
|
51
|
+
|
|
52
|
+
<!--
|
|
53
|
+
<cstyle id="5-0" name="0" size="14.0" rise="0.0" scale="100"
|
|
54
|
+
colour="4f81bd" colid="1" fname="Calibri" fweight="normal" fstyle="normal"
|
|
55
|
+
underline="0" link=""/>
|
|
56
|
+
|
|
57
|
+
<cstyle id="5-1" name="1" size="11.0" rise="0.0" scale="100"
|
|
58
|
+
colour="4f81bd" colid="1" fname="Calibri" fweight="normal" fstyle="normal"
|
|
59
|
+
underline="0" link=""/>
|
|
60
|
+
-->
|
|
61
|
+
<trans-unit id='p5' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
62
|
+
<source>S<g id='5-1' ctype='x-cstyle'>OME POPULAR USE CASE SCENARIOS INCLUDE</g>: </source>
|
|
63
|
+
<target>P<g id="5-1" ctype="x-cstyle">ARMI LES CAS D’UTILISATION LES PLUS COURANTS, CITONS :</g></target>
|
|
64
|
+
</trans-unit>
|
|
65
|
+
|
|
66
|
+
<!--
|
|
67
|
+
<cstyle id="6-0" name="0" size="10.0" rise="0.0" scale="100"
|
|
68
|
+
colour="0" colid="0" fname="Calibri" fweight="normal" fstyle="normal"
|
|
69
|
+
underline="0" link=""/>
|
|
70
|
+
-->
|
|
71
|
+
<trans-unit id='p6' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
72
|
+
<source>Adding high-quality PDF viewing and printing to the base application. </source>
|
|
73
|
+
<target>Ajout d’un affichage et d’une impression PDF de haute qualité à l’application de base. </target>
|
|
74
|
+
</trans-unit>
|
|
75
|
+
|
|
76
|
+
<!--
|
|
77
|
+
<cstyle id="7-0" name="0" size="10.0" rise="0.0" scale="100"
|
|
78
|
+
colour="0" colid="0" fname="Calibri" fweight="normal" fstyle="normal"
|
|
79
|
+
underline="0" link=""/>
|
|
80
|
+
-->
|
|
81
|
+
<trans-unit id='p7' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
82
|
+
<source>Using the unparalleled content extraction API for PDF document repurposing and file conversion. </source>
|
|
83
|
+
<target>Utilisation de l’API d’extraction de contenu inégalée pour la réutilisation de documents PDF et la conversion de fichiers. </target>
|
|
84
|
+
</trans-unit>
|
|
85
|
+
|
|
86
|
+
<!--
|
|
87
|
+
<cstyle id="8-0" name="0" size="10.0" rise="0.0" scale="100"
|
|
88
|
+
colour="0" colid="0" fname="Calibri" fweight="normal" fstyle="normal"
|
|
89
|
+
underline="0" link=""/>
|
|
90
|
+
-->
|
|
91
|
+
<trans-unit id='p8' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
92
|
+
<source>Modifying page content, bookmarks, annotations and any other aspect of a PDF document using unique (one of a kind) content editing API. It takes only a few lines of code, for example, to navigate down into the text on a page, read what is currently there and make changes. </source>
|
|
93
|
+
<target>Modification du contenu de la page, des signets, des annotations et de tout autre aspect d’un document PDF à l’aide d’une API d’édition de contenu unique (unique en son genre). Il suffit de quelques lignes de code, par exemple, pour naviguer dans le texte d’une page, lire ce qui s’y trouve actuellement et apporter des modifications. </target>
|
|
94
|
+
</trans-unit>
|
|
95
|
+
|
|
96
|
+
<!--
|
|
97
|
+
<cstyle id="9-0" name="0" size="10.0" rise="0.0" scale="100"
|
|
98
|
+
colour="0" colid="0" fname="Calibri" fweight="normal" fstyle="normal"
|
|
99
|
+
underline="0" link=""/>
|
|
100
|
+
-->
|
|
101
|
+
<trans-unit id='p9' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
102
|
+
<source>PDF forms manipulation, including merging, extraction, and flattening of form data. </source>
|
|
103
|
+
<target>Manipulation de formulaires PDF, y compris la fusion, l’extraction et l’aplatissement des données de formulaire. </target>
|
|
104
|
+
</trans-unit>
|
|
105
|
+
|
|
106
|
+
<!--
|
|
107
|
+
<cstyle id="10-0" name="0" size="10.0" rise="0.0" scale="100"
|
|
108
|
+
colour="0" colid="0" fname="Calibri" fweight="normal" fstyle="normal"
|
|
109
|
+
underline="0" link=""/>
|
|
110
|
+
-->
|
|
111
|
+
<trans-unit id='p10' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
112
|
+
<source>Merging and assembling PDF documents from existing pages or splitting very large files into smaller documents. </source>
|
|
113
|
+
<target>Fusionner et assembler des documents PDF à partir de pages existantes ou diviser des fichiers très volumineux en documents plus petits. </target>
|
|
114
|
+
</trans-unit>
|
|
115
|
+
|
|
116
|
+
<!--
|
|
117
|
+
<cstyle id="11-0" name="0" size="10.0" rise="0.0" scale="100"
|
|
118
|
+
colour="0" colid="0" fname="Calibri" fweight="normal" fstyle="normal"
|
|
119
|
+
underline="0" link=""/>
|
|
120
|
+
-->
|
|
121
|
+
<trans-unit id='p11' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
122
|
+
<source>Converting PDF pages to high-quality TIFF, PNG, and JPEG bitmaps for dynamic web sites or indexes. Stamping existing PDF pages with text, images and vector art. </source>
|
|
123
|
+
<target>Conversion de pages PDF en bitmaps TIFF, PNG et JPEG de haute qualité pour les sites Web ou les index dynamiques. Estampillage de pages PDF existantes avec du texte, des images et des illustrations vectorielles. </target>
|
|
124
|
+
</trans-unit>
|
|
125
|
+
|
|
126
|
+
<!--
|
|
127
|
+
<cstyle id="12-0" name="0" size="10.0" rise="0.0" scale="100"
|
|
128
|
+
colour="0" colid="0" fname="Calibri" fweight="normal" fstyle="normal"
|
|
129
|
+
underline="0" link=""/>
|
|
130
|
+
|
|
131
|
+
<cstyle id="12-1" name="1" size="10.0" rise="0.0" scale="100"
|
|
132
|
+
colour="0" colid="0" fname="CalibriItalic" fweight="normal" fstyle="italic"
|
|
133
|
+
underline="0" link=""/>
|
|
134
|
+
-->
|
|
135
|
+
<trans-unit id='p12' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
136
|
+
<source>Securing PDF documents using state-of-the-art AES (Advanced Encryption Standard) or custom encryption. Working with digital signatures and integrating the library with third-party certification services. Implementing <g id='12-1' ctype='x-cstyle'>Save As </g>or <g id='12-1' ctype='x-cstyle'>Export </g>feature in client side software, or dynamic server-side PDF generation. Optimizing new or existing documents using linearization (web-optimization), advanced image compression (including JPEG2000 and JBIG2), and by subsetting fonts and removing unnecessary objects. </source>
|
|
137
|
+
<target>Sécurisation des documents PDF à l’aide d’AES (Advanced Encryption Standard) de pointe ou d’un cryptage personnalisé. Travailler avec des signatures numériques et intégrer la bibliothèque à des services de certification tiers. Mise en œuvre de <g id="12-1" ctype="x-cstyle">la fonction Enregistrer sous </g>ou <g id="12-1" ctype="x-cstyle">Exporter </g>dans un logiciel côté client, ou de la génération dynamique de PDF côté serveur. Optimisation de documents nouveaux ou existants à l’aide de la linéarisation (optimisation Web), de la compression d’image avancée (y compris JPEG2000 et JBIG2), de la sous-définition des polices et de la suppression des objets inutiles. </target>
|
|
138
|
+
</trans-unit>
|
|
139
|
+
|
|
140
|
+
<!--
|
|
141
|
+
<cstyle id="13-0" name="0" size="10.0" rise="0.0" scale="100"
|
|
142
|
+
colour="0" colid="0" fname="Calibri" fweight="normal" fstyle="normal"
|
|
143
|
+
underline="0" link=""/>
|
|
144
|
+
-->
|
|
145
|
+
<trans-unit id='p13' approved="yes" translate="yes" xml:space="default" datatype="plaintext">
|
|
146
|
+
<source>Embedding or extracting interactive 3D designs (U3D content), raster images, ICC profiles and file attachments. </source>
|
|
147
|
+
<target>Intégration ou extraction de conceptions 3D interactives (contenu U3D), d’images matricielles, de profils ICC et de pièces jointes. </target>
|
|
148
|
+
</trans-unit>
|
|
149
|
+
|
|
150
|
+
</body>
|
|
151
|
+
</file>
|
|
152
|
+
</xliff>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//---------------------------------------------------------------------------------------
|
|
2
|
+
// Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
|
|
3
|
+
// Consult legal.txt regarding legal and license information.
|
|
4
|
+
//---------------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
//---------------------------------------------------------------------------------------
|
|
7
|
+
// The following sample illustrates how to extract xlf from a PDF document for translation.
|
|
8
|
+
// It then applies a pre-prepared translated xlf file to the PDF to produce a translated PDF.
|
|
9
|
+
//---------------------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
const { PDFNet } = require('@pdftron/pdfnet-node');
|
|
12
|
+
const PDFTronLicense = require('../LicenseKey/LicenseKey');
|
|
13
|
+
|
|
14
|
+
((exports) => {
|
|
15
|
+
|
|
16
|
+
exports.runTransPDF = () => {
|
|
17
|
+
|
|
18
|
+
const main = async () => {
|
|
19
|
+
// Relative path to the folder containing test files.
|
|
20
|
+
const inputPath = '../TestFiles/';
|
|
21
|
+
const outputPath = inputPath + 'Output/';
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
// start stack-based deallocation with startDeallocateStack. Later on when endDeallocateStack is called,
|
|
25
|
+
// all objects in memory that were initialized since the most recent startDeallocateStack call will be
|
|
26
|
+
// cleaned up. Doing this makes sure that memory growth does not get too high.
|
|
27
|
+
await PDFNet.startDeallocateStack();
|
|
28
|
+
|
|
29
|
+
// Open a PDF document to translate
|
|
30
|
+
const doc = await PDFNet.PDFDoc.createFromFilePath(inputPath + 'tagged.pdf');
|
|
31
|
+
|
|
32
|
+
const options = await PDFNet.TransPDF.createTransPDFOptions();
|
|
33
|
+
|
|
34
|
+
// Set the source language in the options
|
|
35
|
+
options.setSourceLanguage("en");
|
|
36
|
+
|
|
37
|
+
// Set the number of pages to process in each batch
|
|
38
|
+
options.setBatchSize(20);
|
|
39
|
+
|
|
40
|
+
// Optionally, subset the pages to process
|
|
41
|
+
// This PDF only has a single page, but you can specify a subset of pages like this
|
|
42
|
+
// options.setPages("-2,5-6,9,11-");
|
|
43
|
+
|
|
44
|
+
// Extract the xlf to file and field the PDF for translation
|
|
45
|
+
await PDFNet.TransPDF.extractXLIFF(doc, outputPath + 'tagged.xlf', options);
|
|
46
|
+
|
|
47
|
+
// Save the fielded PDF
|
|
48
|
+
await doc.save(outputPath + 'tagged-fielded.pdf', PDFNet.SDFDoc.SaveOptions.e_linearized);
|
|
49
|
+
|
|
50
|
+
// The extracted xlf can be translated in a system of your choice.
|
|
51
|
+
// In this sample a pre-prepared translated file is used - tagged_(en_to_fr).xlf
|
|
52
|
+
|
|
53
|
+
// Perform the translation using the pre-prepared translated xliff
|
|
54
|
+
await PDFNet.TransPDF.applyXLIFF(doc, inputPath + "tagged_(en_to_fr).xlf", options);
|
|
55
|
+
|
|
56
|
+
await doc.save(outputPath + 'tagged-fr.pdf', PDFNet.SDFDoc.SaveOptions.e_linearized);
|
|
57
|
+
|
|
58
|
+
await PDFNet.endDeallocateStack();
|
|
59
|
+
} catch (err) {
|
|
60
|
+
console.log(err.stack);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
PDFNet.runWithCleanup(main, PDFTronLicense.Key).catch(function (error) { console.log('Error: ' + JSON.stringify(error)); }).then(function () { return PDFNet.shutdown(); });
|
|
64
|
+
};
|
|
65
|
+
exports.runTransPDF();
|
|
66
|
+
})(exports);
|
|
67
|
+
// eslint-disable-next-line spaced-comment
|
|
68
|
+
//# sourceURL=TransPDF.js
|
package/legal.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Legal Notices:
|
|
3
3
|
-----------------------------------------------------------------------------
|
|
4
4
|
|
|
5
|
-
Copyright (c) 2001-
|
|
5
|
+
Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
|
|
6
6
|
Apryse, PDFTron and PDFNet SDK are either trademarks and/or service marks
|
|
7
7
|
and/or registered trademarks of Apryse Software Incorporated
|
|
8
8
|
in Canada and/or other countries.
|
|
@@ -124,7 +124,7 @@ and fitness for purpose.
|
|
|
124
124
|
---------------------------------------------------------------------------
|
|
125
125
|
Boost
|
|
126
126
|
|
|
127
|
-
CopyRight (c) 2001-
|
|
127
|
+
CopyRight (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
|
|
128
128
|
CopyRight Aaron W. LaFramboise, Roland Schwarz, Michael Glassford 2004.
|
|
129
129
|
CopyRight Anthony Williams 2007
|
|
130
130
|
CopyRight Beman Dawes 2002-2010
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdftron/pdfnet-node-samples",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.4.0",
|
|
4
4
|
"description": "Sample code for the @pdftron/pdfnet-node package.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "run-script-os",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"license": "Commercial",
|
|
13
13
|
"homepage": "https://www.pdftron.com",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@pdftron/pdfnet-node": "^11.
|
|
15
|
+
"@pdftron/pdfnet-node": "^11.4.0",
|
|
16
16
|
"run-script-os": "^1.1.6",
|
|
17
17
|
"underscore": "^1.13.6",
|
|
18
18
|
"xhr2": "^0.2.1"
|
package/readme.md
CHANGED
|
@@ -4,7 +4,7 @@ This package leverages the full power of Apryse's native SDK for maximal perform
|
|
|
4
4
|
|
|
5
5
|
#### Supported platform, Node.js, and Electron versions
|
|
6
6
|
This package depends on unmanaged add-on binaries, and the add-on binaries are not cross-platform. At the moment we have support for
|
|
7
|
-
* **OS**: Linux
|
|
7
|
+
* **OS**: Linux, Windows(x64), Mac
|
|
8
8
|
* **Node.js version**: 8 - 22
|
|
9
9
|
* **Electron version**: 30 - 30
|
|
10
10
|
|
package/TestFiles/pdftron.bmp
DELETED
|
Binary file
|
|
File without changes
|
|
File without changes
|