Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Document-Processing/PDF/PDF-Library/javascript/DigitalSignature.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ let field: PdfSignatureField = new PdfSignatureField(page, 'Signature', {
});
// Create a new signature using PFX data and private key
let sign: PdfSignature = PdfSignature.create(
certData,
password,
{
cryptographicStandard: CryptographicStandard.cms,
digestAlgorithm: DigestAlgorithm.sha256
},
certData,
password
}
);
// Set the signature to the field
field.setSignature(sign);
Expand All @@ -60,7 +60,7 @@ var form = document.form;
// Create a new signature field
var field = new ej.pdf.PdfSignatureField(page, 'Signature', {x: 10, y: 10, width: 100, height: 50});
// Create a new signature using PFX data and private key
var sign = ej.pdf.PdfSignature.create({cryptographicStandard: ej.pdf.CryptographicStandard.cms, digestAlgorithm: ej.pdf.DigestAlgorithm.sha256}, certData, password);
var sign = ej.pdf.PdfSignature.create(certData, password, {cryptographicStandard: ej.pdf.CryptographicStandard.cms, digestAlgorithm: ej.pdf.DigestAlgorithm.sha256});
// Set the signature to the field
field.setSignature(sign);
// Add the field into PDF form
Expand Down Expand Up @@ -94,12 +94,12 @@ let field: PdfSignatureField = new PdfSignatureField(page, 'Signature', {
});
// Create a new signature using PFX data and private key
let sign: PdfSignature = PdfSignature.create(
certData,
password,
{
cryptographicStandard: CryptographicStandard.cms,
digestAlgorithm: DigestAlgorithm.sha256
},
certData,
password
}
);
// Set the signature to the field
field.setSignature(sign);
Expand Down Expand Up @@ -128,12 +128,12 @@ var field = new ej.pdf.PdfSignatureField(page, 'Signature', {
});
// Create a new signature using PFX data and private key
var sign = ej.pdf.PdfSignature.create(
certData,
password,
{
cryptographicStandard: ej.pdf.CryptographicStandard.cms,
digestAlgorithm: ej.pdf.DigestAlgorithm.sha256
},
certData,
password
}
);
// Set the signature to the field
field.setSignature(sign);
Expand Down Expand Up @@ -875,12 +875,12 @@ let externalSignatureCallback = (
};
// Create a new signature using external signing with public certificate collection
let signature: PdfSignature = PdfSignature.create(
externalSignatureCallback,
publicCertificates,
{
cryptographicStandard: CryptographicStandard.cms,
algorithm: DigestAlgorithm.sha256
},
externalSignatureCallback,
publicCertificates
}
);
// Set the signature to the field
field.setSignature(signature);
Expand Down Expand Up @@ -921,12 +921,12 @@ var externalSignatureCallback = function (data, options) {
};
// Create a new signature using external signing with public certificate collection
var signature = ej.pdf.PdfSignature.create(
externalSignatureCallback,
publicCertificates,
{
cryptographicStandard: ej.pdf.CryptographicStandard.cms,
algorithm: ej.pdf.DigestAlgorithm.sha256
},
externalSignatureCallback,
publicCertificates
}
);
// Set the signature to the field
field.setSignature(signature);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ document.splitEvent = documentSplitEvent;
document.split();
// Event to invoke while splitting PDF document data
function documentSplitEvent(sender: PdfDocument, args: PdfDocumentSplitEventArgs): void {
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
}
// Destroy the document
document.destroy();
Expand All @@ -41,7 +41,7 @@ document.splitEvent = documentSplitEvent;
document.split();
// Event to invoke while splitting PDF document data
function documentSplitEvent(sender, args): void {
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
}
// Destroy the document
document.destroy();
Expand All @@ -65,7 +65,7 @@ document.splitEvent = documentSplitEvent;
document.splitByPageRanges([[0, 4], [5, 9]]);
// Event to invoke while splitting PDF document data
function documentSplitEvent(sender: PdfDocument, args: PdfDocumentSplitEventArgs): void {
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
}
// Destroy the document
document.destroy();
Expand All @@ -80,7 +80,7 @@ document.splitEvent = documentSplitEvent;
document.splitByPageRanges([[0, 4], [5, 9]]);
// Event to invoke while splitting PDF document data
function documentSplitEvent(sender, args): void {
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
}
// Destroy the document
document.destroy();
Expand All @@ -104,7 +104,7 @@ document.splitEvent = documentSplitEvent;
document.splitByFixedNumber(1);
// Event to invoke while splitting PDF document data
function documentSplitEvent(sender: PdfDocument, args: PdfDocumentSplitEventArgs): void {
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
}
// Destroy the document
document.destroy();
Expand All @@ -119,7 +119,7 @@ document.splitEvent = documentSplitEvent;
document.splitByFixedNumber(1);
// Event to invoke while splitting PDF document data
function documentSplitEvent(sender, args): void {
Save.save('output_' + args.splitIndex + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
Save.save('output_' + args.index + '.pdf', new Blob([args.pdfData], { type: 'application/pdf' }));
}
// Destroy the document
document.destroy();
Expand Down