Replies: 7 comments
-
There's an svgEditorReady event, where you can load the svg file on load and I've just added info on the save event, where you can hook in to change how it's saved: |
Beta Was this translation helpful? Give feedback.
-
There is already an extension named "ext-php_savefile.js" in extensions folder. How can I use it when someone clicks "Save Image" button.
Where in above code, I can invoke php save extension? Please help |
Beta Was this translation helpful? Give feedback.
-
I have included this extension in following code as well:
|
Beta Was this translation helpful? Give feedback.
-
The save event will be called when clicking the 'save image' button in svg-edit. You will get the data there, which you'll be able to handle as you need. |
Beta Was this translation helpful? Give feedback.
-
Thanks for reply, one more question. Is there a way to set initial zoom level to "Fit to canvas"? |
Beta Was this translation helpful? Give feedback.
-
ok got it, thanks for quick help :) |
Beta Was this translation helpful? Give feedback.
-
sir we want get value in global variable not in function svgEditor.setCustomHandlers({
save: function(win, data) {
// Save svg
}
}); like data within save function that means when we want save then script trigger but my need get data out side function in a variable |
Beta Was this translation helpful? Give feedback.
-
My scenario a little bit different. I have to create a rectangle (upon a background image). Then save that svg into my database. Now when I load that editor again, I need to repopulate that rectangle on my canvas once again (if it already exists in DB).
So the point is.. how may I load any SVG programatically? I know there is a button for opening SVG, but I don't want it, I want to gather SVG information from my DB dynamically and then load it programatically.
Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions