Block Custom Stamps And Use SVG

Product: PDF Tron WebViewer

Product Version: 8.0.0

Please give a brief summary of your issue:
I want to know how Can I block custom stamps, and how can I use svg file as a standard stamp image.

Please describe your issue and provide steps to reproduce it:
I want to know how Can I block custom stamps, and how can I use svg file as a standard stamp image.
I use standard stamp but I can still use custom stamp. I want to block this option so only standard stamp will be avaliable. Is there any possibility to do that?
Second question is how to use svg graphic as a standard stamp image?

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

image

I want to block this button so user cannot create and use custom stamp.

Hi,

Do you still want to use the Standard stamps?

Wanbo

Hi,

Yes, I want to use Standard Stamps with my custom SVG image and disable custom stamps button.
How Can I do this?

Hello,

Can I get any clue how to do it?

Hi,

You can call

instance.UI.disableElement('customStampPanelButton')

to disable custom stamp panel button, and call
https://www.pdftron.com/api/web/Core.Tools.RubberStampCreateTool.html#setStandardStamps
to set standard stamps, sample code as below:

const myStamp = 'ImageDataHere';
instance.docViewer.getTool(instance.Tools.ToolNames.RUBBER_STAMP).setStandardStamps([myStamp]);

Wanbo

Hi,

Code which you sent is working.
I have another question. Now I have to standard stamps, and I want to know which one was selected by user.
Is there any method which will gave me some kind of id or something so I can know which stamp is placed on the document?

MicrosoftTeams-image (23)

Hi,

Please check this event - PDFTron WebViewer Class: AnnotationManager

Thanks.

Wanbo

Hi,

The piont is that I allow user place only one stamp on the document.
And I want to know how can I get some unique value when user click on one of avaliable standard stamps visible on screen even before user place it on a document.

If I can use changeEvent as you said, how can I see which one is placed? I already use this event, but I need to know which one is selected.

Hi,

The ‘annotationChanged’ event (not changeEvent) is for answering you previous question “Is there any method which will gave me some kind of id or something so I can know which stamp is placed on the document?” which will be triggered after a stamp is placed on the document.

And as for event for clicking one of the available stamps, there’s no event for it right now. But you can choose to customize our public UI code to achieve your requirements. Please check https://www.pdftron.com/documentation/web/guides/advanced-customization/.

Thanks.