java - How do I superimpose one SVG image onto another using Apache Batik? -


I have 2 SVG files that I need to overlay while using the bicik. I And 308 pixels x 308 pixels, while the second file (260px to 260px) is a foreground image that should be centered (which is at the center of the background image). I want the results of the operation to be saved in a third SVG file. If you are familiar with Batik, then I appreciate your suggestions.

Thanks,

Olivier.

If you do not need to include the contents of background and foreground documents in the last one, You can use the reference bus:

  & lt; Svg xmlns = 'http: //www.w3.org/2000/svg' xmlns: xlink = 'http: //www.w3.org/1999/xlink' width = '308' height = '308' view box = '0 308 308' & gt; & Lt; Image xlink: href = 'background.svg' width = '308' height = '308' / & gt; & Lt; Image xlink: href = 'foreground svg' x = '24' y = '24 'width =' 260 'height =' 260 '/> & Lt; / Svg & gt;  

This document should be easy to use by using DOM. For an example of using the DOM API to create a document, see.

If you have to pair two documents together, you can do the following:

  • background
  • = document .svg
  • e = document = A. (b.getDocumentElement (), true)
  • > "24" from E
  • call Set a.getDocumentElement () x and y attributes. .appendChild (e)

Now a is a document in which the foreground content is merged.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -