Open geourjoa opened 6 months ago
Job almost done in TextCommentTemplate (need some refactoring to share code between template)
KOnva SVG export not work. I get only empty SVG file
Check case with no shape, one shape (rectangle), multiple shape
@geourjoa As you need a string and not a file, you can generate the data URL (that we know is working) and parse it to get the SVG that is explicit in it.
It seems dirty but honestly it has the advantage of avoiding the handling of a file so it's not that bad.
@geourjoa As you need a string and not a file, you can generate the data URL (that we know is working) and parse it to get the SVG that is explicit in it.
It seems dirty but honestly it has the advantage of avoiding the handling of a file so it's not that bad.
For information, I have fixed this problem by changing the save sequence.
Save the annotation Wait the save finised Close the companion window
The asynchrone saved caused problem because the stage was closed before the export.
I can choose if I export the SVG as string or as blob text.
In mae 1.0.3 currently support only rectangle shape
Into the target form section componenet, add a spatial selector with svg.
The SVG selector has 3 tools :
The first tool allow to select the she shape The second allow to draw selector The last allow to delete
When saving, the IIIF Target is :
If Konva Target layer has shapes :
If Konva Target layer has only one shape and its a rectangle
Extract x y w h and save target as string (see below for an example)
annotation/target
annotation/maedata/targetState
Sample :
Else Target as string
with w canvaWidth and h canvaHeight