Which product are you using?
PDF JS Express
PDF.js Express Version
Im looking for a way to snap the current viewport to a signature annotation. Currently I get the page number and set the viewer to view that page but depending on the zoom level the annotation could be above or below the viewport.
I see that you can get the viewport coordinates, but I cant find a place to set them based off the X/Y values of the annotation.
Code snippet
function GetNextSignature() {
const signatureWidgetAnnots = annotManager.getAnnotationsList().filter(
annot => annot instanceof Annotations.SignatureWidgetAnnotation
);
var found_sig = false;
signatureWidgetAnnots.forEach(widget => {
if (!found_sig) {
if (widget.fieldName.includes('CT_Signature_')) {
console.log(widget);
const isSigned = !!widget.annot;
if (!isSigned) {
found_sig = true;
docViewer.setCurrentPage(widget.PageNumber);
}
}
}
});
}