WebViewer Version: 8.2
I’m trying to serialize a custom annotation (after following the PDFTron) and in the draw()
method of the annotation I need to perform a drawImage()
in the given context because I need to show an image, the problem is, when I try to call super.serialize()
to serialize the other (not custom) properties, it gives the following error:
Uncaught (in promise) DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
I’ve run some tests and the error comes when I add said drawImage()
into the context, otherwise it does not give any problems. In fact I don’t need to save the image in the serialized annotation, but I do need to show it.
Is there any way to tell the super.serialize()
to skip the image? Or to show it but without having to serialize it? Or maybe remove the image temporarily from the canvas while serializing and then adding it again to show it? As I said, I’m calling the super
because I do need the other properties it serializes.
Thanks