Configure maximum file size for annotations?

Product: PDFTron WebViewer

Product Version: 8.0.1

Please give a brief summary of your issue:
Is there a way to limit the size of annotations users are able to add to a document? For example, images or attachment annotations, is there a way to configure a max size of 3MB, and if one was to try to add a larger file we could display an error of some sort?

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,

You can use the ‘ACCEPTED_FILE_SIZE’ in FileAttachmentCreateTool to configure this. And you can listen to the ‘fileRejected’ event for error case.

For example:

const fileTool = instance.Core.documentViewer.getTool(instance.Core.Tools.ToolNames.FILEATTACHMENT);
fileTool.ACCEPTED_FILE_SIZE = 10;
fileTool.addEventListener(instance.Core.Tools.FileAttachmentCreateTool.Events.FILE_REJECTED, (e) => { console.log(e); })

Thanks.

Wanbo