Import seals/signatures from Endpoint

Product: PDFTro

Product Version:

Please give a brief summary of your issue:
(Think of this as an email subject)

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

Hi everyone.

I trying import seals/signatures from endpoint and I have error

This is my code.

			.then((response) => {
				const signatureTool = instanceDocumentViewer.getTool('AnnotationCreateSignature');
				const { data } = response;

				let signatures = => {
					return element.imgData;

			.catch((err) => console.log(err));

And this is a base64 data from the endpoint
[ { "signatureId": 0, "signatureDescription": "TEST IMAGE 1/0", "imageData": "data:image/png;base64,iVBO..." }, { "signatureId": 1, "signatureDescription": "TEST IMAGE 1/1", "imageData": "data:image/png;base64,iVBO..." }, { "signatureId": 2, "signatureDescription": "TEST IMAGE 1/2", "imageData": "data:image/png;base64,iVBOR..." }, ]


In the console, I have the next error
getSignatureDataToStore.js:20 Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘StrokeThickness’)

Please provide a link to a minimal sample where the issue is reproducible:


Thank you for contacting us about WebViewer and for the sample code. Can I confirm what the you are using look like? For the endpoint you mention it has an imageData property. However in your code you had

let signatures = => {
  return element.imgData;

I just want to confirm if the above should be using imageData instead. Besides that, make sure to check the strings in “signatures” are valid base64 images string (that nothing got truncated, or if it has misformatted data). Please let me know if either of those works, if not would it be possible to send a small sample file of you using setMaxSignaturesCount with the data you using? Thank you

Best Regards,

Andrew Yip
Software Developer
PDFTron Systems, Inc.

Hi, thanks for answering.

And its correct, was my bad. From the backend change de property because this reason wasn’t possible fill the dropdowns (seals and signatures).

Thanks so much.


Thank you for the update and I’m glad the solution worked for you. I’ll also add a note in our backlog that the “signatureTool.importSignatures” API should provide better error messages. Feel free to let us know if you have any other questions

Best Regards,

Andrew Yip
Software Developer
PDFTron Systems, Inc.

1 Like