Once the sign field is added on the document programmatically I need to get the element(node) of the sign field when it is clicked so that I can attach listeners to it also once the user add signs to the document the sign should not be draggable in any way.
Also referring to the attached screenshot I need to have custom delete button to delete the selected text field which has been added programmatically.
Does your issue happen with every document, or just one?
Yes
Link to document
{Provide a link to the document in question if possible}
Code snippet
const flags = new WidgetFlags();
flags.set(‘Required’, true);
// create a form field
const field = new Annotations.Forms.Field(client-${Date.now()}, {
type: ‘Sig’,
flags,
});
// create a widget annotation
const widgetAnnot = new Annotations.SignatureWidgetAnnotation(field, {
appearance: '_DEFAULT',
appearances: {
_DEFAULT: {
Normal: {
offset: {
x: 100,
y: 100,
},
},
},
},
});
// set position and size
widgetAnnot.PageNumber = currentPageNumber;
widgetAnnot.X = pageCoordinates.x;
widgetAnnot.Y = pageCoordinates.y;
widgetAnnot.Width = 50;
widgetAnnot.Height = 20;
// add the form field and widget annotation
annotManager.addAnnotation(widgetAnnot);
annotManager.drawAnnotationsFromList([widgetAnnot]);
annotManager.getFieldManager().addField(field);
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here
There already exists a ‘annotationAdded’ event on the SignatureCreateTool so you can listen for that event and enable read only mode when the signature is added.
For the delete button, you can simply get the selected annotations and then delete them.
Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here
Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here
As you can see there are two signature tool so what event can I use that just like other annotations the signature tool should be movable to any position in the document.
Addition to the first point how can I get instance of selected annotation it might be signature tool or form fields.
For any form fields which are added programmatically into the PDF document can we make them movable to any position inside document are there any methods available for that? demo video here : Demo video
Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here
I tried referring the documentation somehow enabled the edit toolbar group but not getting any tools inside that as mentioned in documentation link shared by you. If possible can you share a short snippet that would be great. Here’s the screenshot.
Best Regards,
Zach Serviss
Web Development Support Engineer
PDFTron Systems, Inc.
Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here