Which product are you using?
PDF.js Express Version
(index) Value
UI version | ‘8.1.0’ |
Core version | ‘8.1.1’ |
Build | ‘MTAvMjEvMjAyMXw2OGY2MTQ1NWU=’ |
WebViewer Server | false |
Full API | false |
Detailed description of issue
I have a digitally signed a pdf document with the library, however when I try
to add additional signer it shows the previous signature as “Sign Here”
Expected behaviour
The editor should show the signature image just as I open it as in Adobe Acrobat Reader
including a screenshot below:
Does your issue happen with every document, or just one?
{Answer here}
Link to document
Code snippet
loadViewer(file) {
WebViewer({
path: '../../../../assets/static/lib',
}, this.viewer.nativeElement)
.then(async instance => {
const { Annotations, annotationManager, documentViewer } = instance.Core;
this.wvInstance = instance;
instance.UI.loadDocument(file, { filename: file.name });
documentViewer.addEventListener('annotationsLoaded', () => {
const signatureWidgetAnnots = annotationManager.getAnnotationsList().filter(
annot => annot instanceof Annotations.SignatureWidgetAnnotation
);
signatureWidgetAnnots.forEach((annot) => {
annot.isSignedInitially().then((isSigned) => {
if (isSigned) {
console.log('is signed')
} else {
// if this signature field is not signed initially
}
});
});
})
annotationManager.addEventListener('annotationChanged', (annots, action) => {
const document = documentViewer.getDocument();
if (action === 'add') {
for (const annot of annots) {
if (annot.Subject === 'Signature') {
const { X, Y, Width, Height, PageNumber } = annot;
const { width, height } = document.getPageInfo(PageNumber)
this.signature = this.generateAnnotationImage(annot, 1)
this.coordinates = {
x: X,
y: height - Y
};
}
}
}
if (action === 'modify') {
for (const annot of annots) {
if (annot.Subject === 'Signature') {
const { X, Y, Width, Height, PageNumber } = annot;
const { width, height } = document.getPageInfo(PageNumber);
this.signature = this.generateAnnotationImage(annot, 1)
this.coordinates = {
x: X,
y: height - Y
};
}
}
}
});
});
}
The block quote is saying that annot.isSignedInitially()
is undefined