How to get file name in Image tool

WebViewer Version:
@pdftron/webviewer”: “^7.2.0”,

I want to file name when i uploading using Image tool and want to send on backend server

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 @johnmaniya,

Thanks for reaching out. When an image is selected for the RubberStamp tool, an instance of a rubber stamp annotation is created and added to the document.

Therefore, you can add an event listener on the annotationChanged event and capture when a rubber stamp annotation is added.

annotManager.addEventListener('annotationChanged', (annotations, action) => {
    console.log({ annotations })
    console.log({ action })
    // Here you can check for RubberStamp annotations
  })

annotationChanged docs.

Once you have your annotation, you can call the getImageData method to get the image data, which you can then send to your server. The stamp annotations themselves don’t have a file name, they only store the image data, so you’ll have to store that info elsewhere. If you do want to store it in the annotation you can use the setCustomData and getCustomData APIs.

Best Regards,
Armando Bollain
Software Developer
PDFTron Systems, Inc.
www.pdftron.com