0

I'm currently working with JavaFX 2.2 und Batik. I have an application with a pane on which you can drag multiple SVG pictures. This is all working out, and the svg code of each picture is stored in each object, so I can get that, too.

However now I want to take a "screenshot" of this pane and its current SVG-children and export it as an svg-file.

To me, there are two possibilities:

1) export it with the takeSnapshot() function as a .png-file and convert it to svg

2) or create a new svg-file from all the small svg-files with paying attention to the position of each svg-picture-object.

Is the latter possible? Or does anyone know, whether batik can do this png to svg conversion?

Thanks a lot for your help! :)

user1582432
  • 725
  • 2
  • 7
  • 9

1 Answers1

2

With approach 1) you would loose all vector information and end up effectively with a bitmap. The result would typically be larger (in terms of disk space) and loose quality when it is scaled.

So approach 2) is clearly better. Batik implements SVG DOM so that manipulation of the individual documents should not be to difficult.

Henry
  • 42,982
  • 7
  • 68
  • 84
  • Thanks for your reply! Do you by chance know how to start drawing at a specific position inside an svg? Like a "goto"-command. And probably I would have to chance the coordinates in the small svgs according to their position in the final svg picture, right? – user1582432 Jan 11 '13 at 20:54
  • SVG supports transformations (like scaling, rotation, translation, ...), therefore you do not need to change the coordinates in the sub pictures. I am not sure if you can use them completely unchanged or have to do some unwrapping. Please check the SVG specification for details. – Henry Jan 11 '13 at 21:00