Skip to content

Commit 0c270ef

Browse files
AzureAD\DhakshinPrasathDhanrAzureAD\DhakshinPrasathDhanr
authored andcommitted
Need to Update Digital Signature and Split Document Code Content in EJ2 PDF User Guide documentation
1 parent 4db8720 commit 0c270ef

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

Document-Processing/PDF/PDF-Library/javascript/DigitalSignature.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ let field: PdfSignatureField = new PdfSignatureField(page, 'Signature', {
3232
});
3333
// Create a new signature using PFX data and private key
3434
let sign: PdfSignature = PdfSignature.create(
35+
certData,
36+
password,
3537
{
3638
cryptographicStandard: CryptographicStandard.cms,
3739
digestAlgorithm: DigestAlgorithm.sha256
38-
},
39-
certData,
40-
password
40+
}
4141
);
4242
// Set the signature to the field
4343
field.setSignature(sign);
@@ -60,7 +60,7 @@ var form = document.form;
6060
// Create a new signature field
6161
var field = new ej.pdf.PdfSignatureField(page, 'Signature', {x: 10, y: 10, width: 100, height: 50});
6262
// Create a new signature using PFX data and private key
63-
var sign = ej.pdf.PdfSignature.create({cryptographicStandard: ej.pdf.CryptographicStandard.cms, digestAlgorithm: ej.pdf.DigestAlgorithm.sha256}, certData, password);
63+
var sign = ej.pdf.PdfSignature.create(certData, password, {cryptographicStandard: ej.pdf.CryptographicStandard.cms, digestAlgorithm: ej.pdf.DigestAlgorithm.sha256});
6464
// Set the signature to the field
6565
field.setSignature(sign);
6666
// Add the field into PDF form
@@ -94,12 +94,12 @@ let field: PdfSignatureField = new PdfSignatureField(page, 'Signature', {
9494
});
9595
// Create a new signature using PFX data and private key
9696
let sign: PdfSignature = PdfSignature.create(
97+
certData,
98+
password,
9799
{
98100
cryptographicStandard: CryptographicStandard.cms,
99101
digestAlgorithm: DigestAlgorithm.sha256
100-
},
101-
certData,
102-
password
102+
}
103103
);
104104
// Set the signature to the field
105105
field.setSignature(sign);
@@ -128,12 +128,12 @@ var field = new ej.pdf.PdfSignatureField(page, 'Signature', {
128128
});
129129
// Create a new signature using PFX data and private key
130130
var sign = ej.pdf.PdfSignature.create(
131+
certData,
132+
password,
131133
{
132134
cryptographicStandard: ej.pdf.CryptographicStandard.cms,
133135
digestAlgorithm: ej.pdf.DigestAlgorithm.sha256
134-
},
135-
certData,
136-
password
136+
}
137137
);
138138
// Set the signature to the field
139139
field.setSignature(sign);
@@ -875,12 +875,12 @@ let externalSignatureCallback = (
875875
};
876876
// Create a new signature using external signing with public certificate collection
877877
let signature: PdfSignature = PdfSignature.create(
878+
externalSignatureCallback,
879+
publicCertificates,
878880
{
879881
cryptographicStandard: CryptographicStandard.cms,
880882
algorithm: DigestAlgorithm.sha256
881-
},
882-
externalSignatureCallback,
883-
publicCertificates
883+
}
884884
);
885885
// Set the signature to the field
886886
field.setSignature(signature);
@@ -921,12 +921,12 @@ var externalSignatureCallback = function (data, options) {
921921
};
922922
// Create a new signature using external signing with public certificate collection
923923
var signature = ej.pdf.PdfSignature.create(
924+
externalSignatureCallback,
925+
publicCertificates,
924926
{
925927
cryptographicStandard: ej.pdf.CryptographicStandard.cms,
926928
algorithm: ej.pdf.DigestAlgorithm.sha256
927-
},
928-
externalSignatureCallback,
929-
publicCertificates
929+
}
930930
);
931931
// Set the signature to the field
932932
field.setSignature(signature);

Document-Processing/PDF/PDF-Library/javascript/Split-Documents.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ document.splitEvent = documentSplitEvent;
2626
document.split();
2727
// Event to invoke while splitting PDF document data
2828
function documentSplitEvent(sender: PdfDocument, args: PdfDocumentSplitEventArgs): void {
29-
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
29+
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
3030
}
3131
// Destroy the document
3232
document.destroy();
@@ -41,7 +41,7 @@ document.splitEvent = documentSplitEvent;
4141
document.split();
4242
// Event to invoke while splitting PDF document data
4343
function documentSplitEvent(sender, args): void {
44-
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
44+
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
4545
}
4646
// Destroy the document
4747
document.destroy();
@@ -65,7 +65,7 @@ document.splitEvent = documentSplitEvent;
6565
document.splitByPageRanges([[0, 4], [5, 9]]);
6666
// Event to invoke while splitting PDF document data
6767
function documentSplitEvent(sender: PdfDocument, args: PdfDocumentSplitEventArgs): void {
68-
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
68+
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
6969
}
7070
// Destroy the document
7171
document.destroy();
@@ -80,7 +80,7 @@ document.splitEvent = documentSplitEvent;
8080
document.splitByPageRanges([[0, 4], [5, 9]]);
8181
// Event to invoke while splitting PDF document data
8282
function documentSplitEvent(sender, args): void {
83-
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
83+
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
8484
}
8585
// Destroy the document
8686
document.destroy();
@@ -104,7 +104,7 @@ document.splitEvent = documentSplitEvent;
104104
document.splitByFixedNumber(1);
105105
// Event to invoke while splitting PDF document data
106106
function documentSplitEvent(sender: PdfDocument, args: PdfDocumentSplitEventArgs): void {
107-
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
107+
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
108108
}
109109
// Destroy the document
110110
document.destroy();
@@ -119,7 +119,7 @@ document.splitEvent = documentSplitEvent;
119119
document.splitByFixedNumber(1);
120120
// Event to invoke while splitting PDF document data
121121
function documentSplitEvent(sender, args): void {
122-
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
122+
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
123123
}
124124
// Destroy the document
125125
document.destroy();

0 commit comments

Comments
 (0)