Probably this has been brought up many times. But i need to get a final answer to it.
I have an SVG file loaded onto a browser using an object html tag. Using javascript and the DOM, the user alters that file and customizes its colors elements and alot more. Basically it is a customizer of a jacket. I am not using canvas for this. This is pure svg exported from illustrator and altered.
All is going well until the point where i have to export the altered version of this svg to the server to create a pdf document that contains this customized image. Obviously i need to send an ajax request to the server which contains the base64 string of this image.
Anyone i ask will say that i should create an image via javascript, assign the src attribute to the SVG's serialized XML and then draw it to a canvas to extract the base64 string.
All is well until i hit the toDataURL()
method (or getImageData()
method). It is only working on Firefox. Other browsers are throwing the security breach exception. That is obviously unacceptable.
I have lost hope to get this done since drawing the image to the canvas is tainting it. Is there a way to work around this issue without changing the whole structure of the webpage?