ReactJS: Add the stamp on placeholder when user click on it

Product:

Product Version:8.3.1

We want to add the stamp on my custom place holder when we click on that place holder. We have used RectanglePlaceholder and when user click on this then we open the stamp creation modal . On modal when we click on create button the does not add to the place holder but it instead stick with mouse pointer .

Below is the sample how we are opening the stampmodal:

annotations.forEach((annotation) => {
                if (
                  annotation instanceof Annotations.WidgetAnnotation &&
                  annotation.getField().value === "STAMP" &&
                  annotation.innerElement !== null

                ) {
                  annotation.innerElement.addEventListener("click", (e) => {
                    e.preventDefault();
                    e.stopPropagation();
                    openElements(["customStampModal"]);
                    });
                }
         }
      );

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi Vikas,

Once the custom stamp has been created by the user, you will have to manually place it on your placeholder.
You can get the custom stamp once the user presses create with this API.
The newly created stamp will be the last in the list returned from the API above.
Then you can draw that custom stamp and place it within your placeholder.
Here is the API to draw the stamp. You can just pass in the object from the getCustomStamps API to this API

Please let me know if this doesn’t work for you or if there are any issues.

Best Regards,
Ahmad Moaaz
Software Developer
PDFTron Systems, Inc.
www.pdftron.com