I have 2 SVG files I need to overlay using Batik. One file serve as the background image and is 308px by 308px while the second file (260px by 260px) is the foreground image that must be centered (that is at the center of the background image). I'd like the result of the operation to be saved in a third SVG file. If you are familiar with Batik, I'd appreciate your suggestions.
Thanks,
Olivier.
If you don't need to include the contents of the background and foreground documents in the final one, you can use simply reference them:
It should be simple to construct this document using the DOM. See here for an example of using the DOM APIs to construct a document.
If you need to merge the two documents into one, then you could:
Document
resulting from parsing background.svgDocument
resulting from parsing foreground.svga.
importNode
(b.getDocumentElement(), true)
x
andy
attributes of e to "24"a.getDocumentElement().appendChild(e)
Now a is a document with the foreground contents merged in.