0

Question: Can I draw an SVG inside SVGGraphics2D by calling the drawImage ?

Background

I am making a series of vector images with some text and some image logos in Java, to print on palm leaves.

Image sample given below enter image description here

Ultimately I just want some format which the printer can accept. There are several thousand of pages which we need to print. The printer prints at 0.02mm resolution. The printer comes with some proprietary application called RDWorksV8 and supports a proprietary format called RD and RDL. I want to use a vector format instead of raster to get best possible result from the printer.

I am using Apache Batik to generate SVGs. After generating the vector SVG image, I need to export it to WMF, EMF, or DXF as these are the only formats accepted by RDWorks (the proprietary software which came with the printer); SVG is not accepted by the printer. The RDWords will export the EMF to RD file format which is completely proprietary and not much supported.

The logo is also an SVG file. How do I write the SVG such that it contains the logo SVG and is not too complex to be later converted into a format which is accepted by the printer (such as EMF).

Can I draw an SVG inside SVGGraphics2D by calling the drawImage? How to do this? What is the best way to do it? If not Batik, any suggestions with other libraries like JFreeSVG or FreeHEP Vector Images etc?

  • In principle yes. SVGGraphics2D generates an "image.jpeg" and bases on java.awt.Graphics2D. –  Feb 08 '21 at 14:23
  • image.jpeg means lossy conversion right? svg as it is ? Now I am thinking if would be better to just write raw svg as here https://stackoverflow.com/a/5451238/2448015 and then automating it – Sri Nithya Sharabheshwarananda Feb 08 '21 at 14:29
  • Yes. That is the problem of all imaging formats (jpg, png, etc.) on reducing or enlarging, except SVG. –  Feb 08 '21 at 15:22
  • 1
    Of course, it depends on how the SVG became an Image that you could pass to `drawImage`. – Holger Feb 09 '21 at 17:54

0 Answers0