Rubber Stamp Annotaion not working when opacity is less than 100%

WebViewer Version: 8.5
Can you reproduce using one of our samples or online demos? Yes
Is your issue related to annotations? Yes

when using stamp annotation ,i can’t save my annotation because of error ( webviewer-core.min.js:912 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘width’) )

To reproduce , you can use your online demo then select stamp annotation and change the ocpacity. open your dev tool consol you will see the error .

link: PDFTron WebViewer Demo: JavaScript PDF Viewer Demo

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:

Hello cissea,

Thank you for reporting this bug to WebViewer Support!

It looks like this was actually caused by an update in WebViewer 8.6 (the version our demo is currently using) and is not an issue on 8.5, so you should be able to use the rubber stamp tool fine on 8.5 in your own application if needed.

In the meantime, we’ve added the issue to our backlog to be worked on in the future. We don’t have a timeline for when it will be fixed but if it does get fixed we’ll let you know when it’s available in an experimental build to test out and the estimated official release date. If you have a desired timeline for having this issue fixed please let us know and we’ll do our best to work with you on how this can fit into the WebViewer release schedule.

Best Regards,
Carlo Mendoza
Software Developer
PDFTron Systems, Inc.
www.pdftron.com

Hello carlo,
thank you for your answer. i’m currently using the version 8.6! its possible to fix That issue as soon as possible? Otherwise is any feature how to disable the rubber stamp opacity whitout using css?

thank you

Hello cissea,

One way that you can disable rubber stamp opacity changing would be to disable the annotation style edit button when a rubber stamp annotation is selected. I have an example of how you can do this by adding an event listener to check the last selected annotation to see if it is a rubber stamp and then disable the button here:

const { annotationManager } = instance.Core;
  
annotationManager.addEventListener('annotationSelected', (annotations, action) => {
  if (action === 'selected' && annotations[0].ToolName ===instance.Core.Tools.ToolNames['RUBBER_STAMP']) {
    instance.UI.disableElement('annotationStyleEditButton');
  } else {
    instance.UI.enableElement('annotationStyleEditButton');
  }
});

*Note that when it comes to re-enabling the button there could be more checks required if you disable the button in different circumstances so that you don’t have it enabled in those because of this solution.

More information on annotation events and customizations can be found in our guides here: PDFTron Systems Inc. | Documentation

Best Regards,
Carlo Mendoza
Software Developer
PDFTron Systems, Inc.
www.pdftron.com

Hello Carlo,
Thank you